CREATE OR REPLACE PACKAGE ORA_EXCEL IS
   /*
    *  ORAEXCEL version 3.2.40
    *  Documentation and examples available on http://www.oraexcel.com/documentation
    *
    */
    license_key VARCHAR2(100):= '0756012407598791';

    /***************************************************************************
    *
    * ORA_EXCEL COPYRIGHT AND LEGAL NOTES
    *
    * This software is protected by International copyright Law. Unauthorized use,
    * duplication, reverse engineering, any form of redistribution, or use in part
    * or in whole other than by prior, express, printed and signed license for use
    * is subject to civil and criminal prosecution. If you have received this file
    * in error, please notify copyright holder and destroy this and any other copies
    * as instructed.
    *
    * END-USER LICENSE AGREEMENT FOR ORA_EXCEL IMPORTANT PLEASE READ THE TERMS AND
    * CONDITIONS OF THIS LICENSE AGREEMENT CAREFULLY BEFORE CONTINUING WITH THIS
    * PROGRAM INSTALL: ORA_EXCEL End-User License Agreement ("EULA") is a legal
    * agreement between you (either an individual or a single entity) and ORA_EXCEL.
    * For the ORA_EXCEL software product(s) identified above which may include
    * associated software components, media, printed materials, and "online" or
    * electronic documentation ("ORA_EXCEL"). By installing, copying, or otherwise
    * using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA.
    * This license agreement represents the entire agreement concerning the program
    * between you and ORA_EXCEL, (referred to as "licenser"), and it supersedes any
    * prior proposal, representation, or understanding between the parties. If you
    * do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT.
    *
    * The SOFTWARE PRODUCT is protected by copyright laws and international copyright
    * treaties, as well as other intellectual property laws and treaties.
    * The SOFTWARE PRODUCT is licensed, not sold.
    *
    * 1. GRANT OF LICENSE.
    * The SOFTWARE PRODUCT is licensed as follows:
    * (a) Installation and Use.
    * ORA_EXCEL grants you the right to install and use copies of the SOFTWARE PRODUCT
    * on your computer running a validly licensed copy of the operating system for which
    * the SOFTWARE PRODUCT was designed.
    * (b) Backup Copies.
    * You may also make copies of the SOFTWARE PRODUCT as may be necessary for backup
    * and archival purposes.
    *
    * 2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
    * (a) Maintenance of Copyright Notices.
    * You must not remove or alter any copyright notices on any and all copies of the
    * SOFTWARE PRODUCT.
    * (b) Distribution.
    * You may not distribute registered copies of the SOFTWARE PRODUCT to third parties.
    * Evaluation versions available for download from ORA_EXCEL's websites may be freely
    * distributed.
    * (c) Prohibition on Reverse Engineering, Decompilation, and Disassembly.
    * You may not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT,
    * except and only to the extent that such activity is expressly permitted by
    * applicable law notwithstanding this limitation.
    * (d) Rental.
    * You may not rent, lease, or lend the SOFTWARE PRODUCT.
    * (e) Support Services.
    * ORA_EXCEL may provide you with support services related to the SOFTWARE PRODUCT
    * ("Support Services"). Any supplemental software code provided to you as part of
    * the Support Services shall be considered part of the SOFTWARE PRODUCT and subject
    * to the terms and conditions of this EULA.
    * (f) Compliance with Applicable Laws.
    * You must comply with all applicable laws regarding use of the SOFTWARE PRODUCT.
    * 3. TERMINATION
    * Without prejudice to any other rights, ORA_EXCEL may terminate this EULA if you
    * fail to comply with the terms and conditions of this EULA. In such event, you must
    * destroy all copies of the SOFTWARE PRODUCT in your possession.
    * 4. COPYRIGHT
    * All title, including but not limited to copyrights, in and to the SOFTWARE PRODUCT
    * and any copies thereof are owned by ORA_EXCEL or its suppliers. All title and
    * intellectual property rights in and to the content which may be accessed through
    * use of the SOFTWARE PRODUCT is the property of the respective content owner and
    * may be protected by applicable copyright or other intellectual property laws and
    * treaties. This EULA grants you no rights to use such content. All rights not
    * expressly granted are reserved by ORA_EXCEL.
    * 5. NO WARRANTIES
    * ORA_EXCEL expressly disclaims any warranty for the SOFTWARE PRODUCT.
    * The SOFTWARE PRODUCT is provided 'As Is' without any express or implied warranty
    * of any kind, including but not limited to any warranties of merchantability,
    * noninfringement, or fitness of a particular purpose. ORA_EXCEL does not warrant
    * or assume responsibility for the accuracy or completeness of any information,
    * text, graphics, links or other items contained within the SOFTWARE PRODUCT.
    * ORA_EXCEL makes no warranties respecting any harm that may be caused by the
    * transmission of a computer virus, worm, time bomb, logic bomb, or other such
    * computer program. ORA_EXCEL further expressly disclaims any warranty or
    * representation to Authorized Users or to any third party.
    * 6. LIMITATION OF LIABILITY
    * In no event shall ORA_EXCEL be liable for any damages (including, without
    * limitation, lost profits, business interruption, or lost information) rising
    * out of 'Authorized Users' use of or inability to use the SOFTWARE PRODUCT,
    * even if ORA_EXCEL has been advised of the possibility of such damages.
    * In no event will ORA_EXCEL be liable for loss of data or for indirect,
    * special, incidental, consequential (including lost profit), or other
    * damages based in contract, tort or otherwise. ORA_EXCEL shall have no
    * liability with respect to the content of the SOFTWARE PRODUCT or any part
    * thereof, including but not limited to errors or omissions contained therein,
    * libel, infringements of rights of publicity, privacy, trademark rights,
    * business interruption, personal injury, loss of privacy, moral rights or
    * the disclosure of confidential information.
    *
    ****************************************************************************/



    TYPE "@1" IS RECORD ("@2" VARCHAR2(10),
                                           "@3" NUMBER,
                                           "@4" INTEGER DEFAULT 0);
    TYPE "@5" IS TABLE OF "@1";
    "@6" "@5" := "@5"();


    TYPE "@952" IS RECORD ("@854" VARCHAR2(100),
                                       "@855" NUMBER,
                                       "@856" VARCHAR2(100));
    TYPE "@857" IS TABLE OF "@952";
    "@858" "@857" := "@857"();


    TYPE "@7" IS RECORD("@8" VARCHAR2(100));
    TYPE "@9" IS TABLE OF "@7";
    "@10" "@9" := "@9"();


    TYPE "@11" IS RECORD ("@12" VARCHAR2(1000),
                                    "@13" VARCHAR2(10));
    TYPE "@14" IS table OF "@11";
    "@26" "@14" := "@14"();

    TYPE "@728" IS RECORD ("@12" VARCHAR2(1000),
                                             "@13" VARCHAR2(10));
    TYPE "@729" IS table OF "@728";
    "@730" "@729" := "@729"();



    TYPE "@15" IS RECORD ("@16" VARCHAR2(1000),
                                  "@17" VARCHAR2(30),
                                  "@18" NUMBER,
                                  "@19" NUMBER,
                                  "@20" INTEGER,
                                  "@21" INTEGER,
                                  "@22" VARCHAR2(10));
    TYPE "@23" IS TABLE OF "@15";
    "@27" "@23" := "@23"();

    TYPE "@24" IS TABLE OF CLOB;
    "@25" "@24" := "@24"();


    TYPE "@28" IS RECORD ("@29" VARCHAR2(20),
                                      "@30" VARCHAR2(1),
                                      "@31" VARCHAR2(100),
                                      "@32" PLS_INTEGER := 0,
                                      "@33" PLS_INTEGER := 0,
                                      "@34" PLS_INTEGER := 0,
                                      "@35" PLS_INTEGER := 0,
                                      "@36" PLS_INTEGER := 0,
                                      "@37" PLS_INTEGER,
                                      "@38" VARCHAR2(4000),
                                      "@39" BOOLEAN := FALSE,
                                      "@40" BOOLEAN := FALSE,
                                      "@41" BOOLEAN := FALSE,
                                      "@42" VARCHAR2(8),
                                      "@43" VARCHAR2(8),
                                      "@44" VARCHAR2(1),
                                      "@45" VARCHAR2(1),
                                      "@46" BOOLEAN DEFAULT FALSE,
                                      "@47" BOOLEAN DEFAULT FALSE,
                                      "@48" VARCHAR2(6),
                                      "@49" VARCHAR2(8),
                                      "@50" BOOLEAN DEFAULT FALSE,
                                      "@51" VARCHAR2(6),
                                      "@52" VARCHAR2(8),
                                      "@53" BOOLEAN DEFAULT FALSE,
                                      "@54" VARCHAR2(6),
                                      "@55" VARCHAR2(8),
                                      "@56" BOOLEAN DEFAULT FALSE,
                                      "@57" VARCHAR2(6),
                                      "@58" VARCHAR2(8),
                                      "@59" VARCHAR2(10),
                                      "@60" VARCHAR2(8),
                                      "@61" BOOLEAN DEFAULT FALSE,
                                      "@62" BOOLEAN,
                                      "@63" VARCHAR2(10),
                                      "@64" VARCHAR2(10),
                                      "@65" PLS_INTEGER,
                                      "@66" BOOLEAN,
                                      "@67" PLS_INTEGER := 0,
                                      "@68" INTEGER := 0,
                                      "@69" INTEGER := 0,
                                      "@70" INTEGER := 0,
                                      "@370" CLOB,
                                      "@9911" BOOLEAN DEFAULT NULL);
    "@71" "@28";
    TYPE "@72" IS TABLE OF "@28" INDEX BY PLS_INTEGER;

    "@73" "@72";

    TYPE "@444" IS RECORD ("@445" NUMBER,
                                              "@446" NUMBER,
                                              "@447" NUMBER);
    TYPE "@450" IS TABLE OF "@444";
    "@449" "@450" := "@450"();



    TYPE "@1500" IS RECORD ("@1501" VARCHAR2(50),
                                            "@1502" VARCHAR2(20),
                                            "@1503" VARCHAR2(20),
                                            "@1504" VARCHAR2(1000),
                                            "@1518" VARCHAR2(1000),
                                            "@1505" NUMBER,
                                            "@1516" NUMBER);


    TYPE "@1511" IS TABLE OF "@1500";
    "@1512" "@1511" := "@1511"();




    TYPE "@74" IS RECORD ("@75" VARCHAR2(32),
                                "@76" CLOB,
                                "@77" "@24",
                                "@78" PLS_INTEGER,
                                "@79" PLS_INTEGER,
                                "@180" "@5",
                                "@181" "@9",
                                "@80" BOOLEAN DEFAULT FALSE,
                                "@81" NUMBER,
                                "@82" NUMBER,
                                "@83" NUMBER,
                                "@84" NUMBER,
                                "@85" NUMBER,
                                "@86" NUMBER,
                                "@87" VARCHAR2(10),
                                "@88" INTEGER,
                                "@89" VARCHAR2(1000),
                                "@92" VARCHAR2(1000),
                                "@182" "@14",
                                "@731" "@729",
                                "@183" "@23",
                                "@90" VARCHAR2(20),
                                "@91" VARCHAR2(20),
                                "@93" "@72",
                                "@94" NUMBER,
                                "@95" BOOLEAN,
                                "@892" VARCHAR2(20),
                                "@893" VARCHAR2(20),
                                "@442" NUMBER,
                                "@443" NUMBER,
                                "@448" "@450",
                                "@573" NUMBER DEFAULT 0,
                                "@574" CLOB,
                                "@575" VARCHAR2(32767),
                                "@798" VARCHAR2(20),
                                "@879" NUMBER,
                                "@911" BOOLEAN,
                                "@792" VARCHAR2(4000),
                                "@793" VARCHAR2(1000),
                                "@794" VARCHAR2(1000),
                                "@1513" "@1511",
                                "@1514" NUMBER DEFAULT 0,
                                "@7541" BOOLEAN DEFAULT FALSE,
                                "@7542" VARCHAR2(10),
                                "@7544" BOOLEAN DEFAULT FALSE,
                                "@7545" BOOLEAN DEFAULT FALSE,
                                "@7546" BOOLEAN DEFAULT FALSE,
                                "@7547" BOOLEAN DEFAULT FALSE,
                                "@7548" BOOLEAN DEFAULT FALSE,
                                "@7549" BOOLEAN DEFAULT FALSE,
                                "@7550" BOOLEAN DEFAULT FALSE,
                                "@7551" BOOLEAN DEFAULT FALSE,
                                "@7552" BOOLEAN DEFAULT FALSE,
                                "@7553" BOOLEAN DEFAULT FALSE,
                                "@7554" BOOLEAN DEFAULT FALSE,
                                "@8124" BOOLEAN DEFAULT FALSE,
                                "@8125" BOOLEAN DEFAULT FALSE,
                                "@8126" BOOLEAN DEFAULT FALSE,
                                "@8127" BOOLEAN DEFAULT FALSE);


    TYPE "@96" IS TABLE OF "@74";
    "@97" "@96" := "@96"();



    TYPE "@98" IS RECORD("@184" VARCHAR(200));
    TYPE "@99" IS TABLE OF "@98";
    "@100" "@99" := "@99"();


    TYPE "@101" IS RECORD ("@102" PLS_INTEGER,
                                "@103" PLS_INTEGER,
                                "@104" PLS_INTEGER,
                                "@105" PLS_INTEGER,
                                "@106" PLS_INTEGER,
                                "@107" VARCHAR2(1),
                                "@108" VARCHAR2(1),
                                "@109" BOOLEAN,
                                "@110" INTEGER,
                                "@111" INTEGER,
                                "@112" INTEGER,
                                "@9352" BOOLEAN DEFAULT TRUE);
    TYPE "@113" IS table OF "@101";
    "@114" "@113" := "@113"();




    TYPE "@115" IS RECORD ("@116" PLS_INTEGER,
                               "@117" VARCHAR2(100),
                               "@118" BOOLEAN := FALSE,
                               "@119" BOOLEAN := FALSE,
                               "@120" BOOLEAN := FALSE,
                               "@121" VARCHAR2(8));
    TYPE "@122" IS table OF "@115";
    "@123" "@122" := "@122"();


    TYPE "@124" IS RECORD ("@125" VARCHAR2(10),
                               "@126" VARCHAR2(8));
    TYPE "@127" IS TABLE OF "@124";
    "@128" "@127" := "@127"();



    TYPE "@129" IS RECORD ("@130" PLS_INTEGER,
                                      "@131" VARCHAR2(100));


    TYPE "@132" IS RECORD ("@133" BOOLEAN DEFAULT FALSE,
                                 "@134" VARCHAR2(6),
                                 "@135" VARCHAR2(8),
                                 "@136" BOOLEAN DEFAULT FALSE,
                                 "@137" VARCHAR2(6),
                                 "@138" VARCHAR2(8),
                                 "@139" BOOLEAN DEFAULT FALSE,
                                 "@140" VARCHAR2(6),
                                 "@141" VARCHAR2(8),
                                 "@142" BOOLEAN DEFAULT FALSE,
                                 "@143" VARCHAR2(6),
                                 "@144" VARCHAR2(8),
                                 "@145" VARCHAR2(10),
                                 "@146" VARCHAR2(8));
    TYPE "@147" IS TABLE OF "@132";
    "@148" "@147" := "@147"();


    TYPE "@149" IS TABLE OF CLOB;
    "@150" "@149" := "@149"();

    TYPE "@753" IS RECORD ("@752" VARCHAR2(20),
                                "@754" VARCHAR2(100),
                                "@755" PLS_INTEGER,
                                "@38" VARCHAR2(4000),
                                "@39" BOOLEAN := FALSE,
                                "@40" BOOLEAN := FALSE,
                                "@41" BOOLEAN := FALSE,
                                "@42" VARCHAR2(8),
                                "@43" VARCHAR2(8),
                                "@44" VARCHAR2(20),
                                "@45" VARCHAR2(20),
                                "@47" BOOLEAN DEFAULT FALSE,
                                "@48" VARCHAR2(6),
                                "@49" VARCHAR2(8),
                                "@50" BOOLEAN DEFAULT FALSE,
                                "@51" VARCHAR2(6),
                                "@52" VARCHAR2(8),
                                "@53" BOOLEAN DEFAULT FALSE,
                                "@54" VARCHAR2(6),
                                "@55" VARCHAR2(8),
                                "@56" BOOLEAN DEFAULT FALSE,
                                "@57" VARCHAR2(6),
                                "@58" VARCHAR2(8),
                                "@756" BOOLEAN,
                                "@59" VARCHAR2(10),
                                "@60" VARCHAR2(8),
                                "@61" BOOLEAN DEFAULT FALSE,
                                "@67" VARCHAR2(60) := NULL,
                                "@68" INTEGER := 0,
                                "@69" INTEGER := 0,
                                "@70" INTEGER := 0,
                                "@764" INTEGER :=0);


    TYPE "@757" IS TABLE OF "@753" INDEX BY VARCHAR2(50);


    TYPE "@1519" IS RECORD ("@1506" BOOLEAN DEFAULT FALSE,
                                                  "@1507" BOOLEAN DEFAULT FALSE,
                                                  "@1508" BOOLEAN DEFAULT FALSE,
                                                  "@1509" BOOLEAN DEFAULT FALSE,
                                                  "@1510" VARCHAR2(10),
                                                  "@1530" VARCHAR2(8));


    TYPE "@1520" IS TABLE OF "@1519";
    "@1521" "@1520" := "@1520"();





    TYPE "@151" IS RECORD ("@152" "@96",
                                   "@153" CLOB,
                                   "@154" "@149",
                                   "@155" PLS_INTEGER,
                                   "@156" "@99",
                                   "@157" "@113",
                                   "@158" "@122",
                                   "@159" "@129",
                                   "@160" "@127",
                                   "@161" "@147",
                                   "@162" BOOLEAN,
                                   "@732" BOOLEAN,
                                   "@582" VARCHAR2(1000),
                                   "@758" "@757",
                                   "@859" "@857",
                                   "@1515" NUMBER DEFAULT -1,
                                   "@1523" "@1520",
                                   "@3542" BOOLEAN DEFAULT FALSE,
                                   "@9912" BOOLEAN := TRUE);

    TYPE "@163" IS TABLE OF "@151";
    "@164" "@163";
    "@165" "@163" := "@163"();


    doc_id PLS_INTEGER := 0;
    current_doc_id PLS_INTEGER;
    current_sheet_id PLS_INTEGER;
    current_row_id PLS_INTEGER;
    "@167" CLOB;
    "@168" PLS_INTEGER;
    "@169" BOOLEAN := FALSE;



    "@170" PLS_INTEGER;
    "@171" VARCHAR2(20);
    "@172" VARCHAR2(20);
    "@173" PLS_INTEGER;

    "@270" NUMBER := 4000;
    "@271" NUMBER := 32767;

    TYPE "@174" IS TABLE OF VARCHAR2(32767 CHAR) INDEX BY PLS_INTEGER;
    "@175" "@174";

    TYPE "@176" IS TABLE OF VARCHAR2(32767 CHAR) INDEX BY PLS_INTEGER;
    "@177" "@176";

    TYPE "@178" IS TABLE OF VARCHAR2(32767 CHAR) INDEX BY PLS_INTEGER;
    "@179" "@178";

    "@300" BLOB := EMPTY_BLOB();
    "@301" CLOB := EMPTY_CLOB();
    "@302" CLOB := EMPTY_CLOB();

    TYPE cell_value_type IS RECORD(value VARCHAR2(32767),
                                   varchar2_value VARCHAR2(32767),
                                   number_value NUMBER,
                                   date_value DATE,
                                   type VARCHAR2(1));
    "@309" INTEGER;
    "@310" CLOB;
    TYPE "@311" IS TABLE OF VARCHAR2(1) INDEX BY PLS_INTEGER;
    "@312" "@311";
    "@313" "@311";
    "@314" VARCHAR2(4);
    "@315" VARCHAR2(30);
    "@452" INTEGER;

    /***************************************************************************
    * Description: Creates new instance of excel document, initializes space
    *  storage and prepares parameters
    *
    * Input Parameters:
    *   - no input parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - doc_id [unique identifier of document]
    *
    ****************************************************************************/
    FUNCTION new_document
    RETURN PLS_INTEGER;



    /***************************************************************************
    * Description: Wrapper procedure of new_document function
    *
    * Input Parameters:
    *   - no input parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE new_document;



    /***************************************************************************
    * Description: Adds new sheet to document
    *
    * Input Parameters:
    *   - sheet_name [sheet name that will be displayed on sheet tab]
    *   - doc_id     [unique identificator od document]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - sheet_id  [unique identificator of sheet within document]
    *
    ****************************************************************************/
    FUNCTION add_sheet(sheet_name VARCHAR2,
                       doc_id PLS_INTEGER DEFAULT current_doc_id)
    RETURN PLS_INTEGER;



    /***************************************************************************
    * Description: Wrapper procedure of add_sheet function
    *
    * Input Parameters:
    *   - sheet_name [sheet name that will be displayed on sheet tab]
    *   - doc_id     [unique identificator of document]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_sheet(sheet_name VARCHAR2,
                        doc_id PLS_INTEGER DEFAULT current_doc_id);



    /***************************************************************************
    * Description: Adds row to current or specified sheet
    *
    * Input Parameters:
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - row_id    [unique identificator of row within specified sheed and document]
    *
    ****************************************************************************/
    FUNCTION add_row(doc_id PLS_INTEGER DEFAULT current_doc_id,
                     sheet_id PLS_INTEGER DEFAULT current_sheet_id) RETURN PLS_INTEGER;



    /***************************************************************************
    * Description: Wrapper procedure for add_row function
    *
    * Input Parameters:
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_row(doc_id PLS_INTEGER DEFAULT current_doc_id,
                      sheet_id PLS_INTEGER DEFAULT current_sheet_id);



    /***************************************************************************
    * Description: Sets height of speficied row
    *
    * Input Parameters:
    *   - height     [height of the row]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_row_height(height NUMBER,
                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                             sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                             row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets value of numeric cell
    *
    * Input Parameters:
    *   - name       [name of the cell where value will be added]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_value (name VARCHAR2,
                              value NUMBER,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                              row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets value of string cell
    *
    * Input Parameters:
    *   - name       [name of the cell where value will be added]
    *   - value      [date value that will be set to the cell]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_value (name VARCHAR2,
                              value VARCHAR2,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                              row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets value of cell with internal xml string
    *
    * Input Parameters:
    *   - name       [name of the cell where value will be added]
    *   - value      [xml value that will be added to cell]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_internal_code (name VARCHAR2,
                                      value CLOB,
                                      doc_id PLS_INTEGER DEFAULT current_doc_id,
                                      sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                      row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets value of date cell
    *
    * Input Parameters:
    *   - name       [name of the cell where value will be added]
    *   - value      [date value that will be set to the cell]
    *   - doc_id     [unique identificator of document
    *   - sheet_id   [unique identificator of sheet
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_value (name VARCHAR2,
                              value DATE,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                              row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets value of big string cell (CLOB)
    *
    * Input Parameters:
    *   - name       [name of the cell where value will be added]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_value (name VARCHAR2,
                              value CLOB,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                              row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets format of the cell
    *
    * Input Parameters:
    *   - cell_name  [name of the cell on which format will be applied]
    *   - format     [format mask that will be applied to the cell, same as custom format in Excel]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_format (cell_name VARCHAR2,
                               format VARCHAR2,
                               doc_id PLS_INTEGER DEFAULT current_doc_id,
                               sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                               row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Generates Excel document and stores it in BLOB variable
    *
    * Input Parameters:
    *   - blob_file  [BLOB variable where generated Excel will be stored]
    *   - doc_id     [unique identificator of document]
    *
    * Output Parameters:
    *   - blob_file  [BLOB variable where generated Excel will be stored]
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE save_to_blob(blob_file IN OUT BLOB,
                           doc_id PLS_INTEGER DEFAULT current_doc_id);



    /***************************************************************************
    * Description: Sets font family of the cell
    *
    * Input Parameters:
    *   - cell_name  [name of the cell on which format will be applied]
    *   - font_name  [font family which will be applied to the cell ex. Arial]
    *   - font_size  [size that will be applied to the font for specified cell]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_font(cell_name VARCHAR2,
                            font_name VARCHAR2,
                            font_size PLS_INTEGER DEFAULT 10,
                            doc_id PLS_INTEGER DEFAULT current_doc_id,
                            sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                            row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets default font family for whole document
    *
    * Input Parameters:
    *   - font_name  [font family which will be applied to whole document ex. Arial]
    *   - font_size  [size that will be applied to the font for whole document]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_default_font (font_name VARCHAR2 DEFAULT 'Calibri',
                                font_size PLS_INTEGER DEFAULT 11,
                                doc_id PLS_INTEGER DEFAULT current_doc_id);



    /***************************************************************************
    * Description: Sets cell type to bold
    *
    * Input Parameters:
    *   - name       [name of cell which content will be bolded]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_bold(name VARCHAR2,
                            doc_id PLS_INTEGER DEFAULT current_doc_id,
                            sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                            row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets cell stype to italic
    *
    * Input Parameters:
    *   - name       [name of cell which content will be formated to italic]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_italic(name VARCHAR2,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                              row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets cell stype to underline
    *
    * Input Parameters:
    *   - name       [name of cell which content will be underline]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_underline(name VARCHAR2,
                                 doc_id PLS_INTEGER DEFAULT current_doc_id,
                                 sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                 row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets color of font within cell
    *
    * Input Parameters:
    *   - name       [name of cell which font will be colored]
    *   - color      [font color in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_color(name VARCHAR2,
                             color VARCHAR2,
                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                             sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                             row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets background color of cell
    *
    * Input Parameters:
    *   - name       [name of cell which background will be colored]
    *   - color      [background color in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_bg_color(name VARCHAR2,
                                color VARCHAR2,
                                doc_id PLS_INTEGER DEFAULT current_doc_id,
                                sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets left side horizontal alignement of cell
    *
    * Input Parameters:
    *   - name       [name of cell content will be placed to left side of column]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_align_left(name VARCHAR2,
                                 doc_id PLS_INTEGER DEFAULT current_doc_id,
                                 sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                 row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets horizontal alignement of cell to center
    *
    * Input Parameters:
    *   - name       [name of cell content will be centered]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_align_center(name VARCHAR2,
                                    doc_id PLS_INTEGER DEFAULT current_doc_id,
                                    sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                    row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets horizontal alignement of cell to right
    *
    * Input Parameters:
    *   - name       [name of cell content will be placed to right side of column]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_align_right(name VARCHAR2,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                   row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets vertical alignement of cell to top
    *
    * Input Parameters:
    *   - name       [name of cell content will be placed to the top]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_vert_align_top(name VARCHAR2,
                                      doc_id PLS_INTEGER DEFAULT current_doc_id,
                                      sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                      row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets vertical alignement of cell to middle
    *
    * Input Parameters:
    *   - name       [name of cell content will be placed in the middle]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_vert_align_middle(name VARCHAR2,
                                         doc_id PLS_INTEGER DEFAULT current_doc_id,
                                         sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                         row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets vertical alignement of cell to bottom
    *
    * Input Parameters:
    *   - name       [name of cell content will be placed to the bottom]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_vert_align_bottom(name VARCHAR2,
                                         doc_id PLS_INTEGER DEFAULT current_doc_id,
                                         sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                         row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets width of the column
    *
    * Input Parameters:
    *   - name       [name of the column which width will be set to specified value]
    *   - width      [width of column]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_column_width(name VARCHAR2,
                               width NUMBER,
                               doc_id PLS_INTEGER DEFAULT current_doc_id,
                               sheet_id PLS_INTEGER DEFAULT current_sheet_id);



    /***************************************************************************
    * Description: Sets top border of the cell
    *
    * Input Parameters:
    *   - name       [name of cell on which top border will be set]
    *   - style      [style of the border:  thin, thick, double]
    *   - color      [color of border in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_border_top(name VARCHAR2,
                                  style VARCHAR2 DEFAULT 'thin',
                                  color VARCHAR2 DEFAULT '00000000',
                                  doc_id PLS_INTEGER DEFAULT current_doc_id,
                                  sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                  row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets bottom border of the cell
    *
    * Input Parameters:
    *   - name       [name of cell on which bottom border will be set]
    *   - style      [style of the border:  thin, thick, double]
    *   - color      [color of border in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_border_bottom(name VARCHAR2,
                                     style VARCHAR2 DEFAULT 'thin',
                                     color VARCHAR2 DEFAULT '00000000',
                                     doc_id PLS_INTEGER DEFAULT current_doc_id,
                                     sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                     row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets left border of the cell
    *
    * Input Parameters:
    *   - name       [name of cell on which left border will be set]
    *   - style      [style of the border:  thin, thick, double]
    *   - color      [color of border in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_border_left(name VARCHAR2,
                                   style VARCHAR2 DEFAULT 'thin',
                                   color VARCHAR2 DEFAULT '00000000',
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                   row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets right border of the cell
    *
    * Input Parameters:
    *   - name       [name of cell on which right border will be set]
    *   - style      [style of the border:  thin, thick, double]
    *   - color      [color of border in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_border_right(name VARCHAR2,
                                    style VARCHAR2 DEFAULT 'thin',
                                    color VARCHAR2 DEFAULT '00000000',
                                    doc_id PLS_INTEGER DEFAULT current_doc_id,
                                    sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                    row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets border of the cell
    *
    * Input Parameters:
    *   - name       [name of cell on which border will be set]
    *   - style      [style of the border:  thin, thick, double]
    *   - color      [color of border in RRGGBB hex format RR - red, GG - green, BB blue]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_border(name VARCHAR2,
                              style VARCHAR2 DEFAULT 'thin',
                              color VARCHAR2 DEFAULT '00000000',
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                              row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Fetches data with speified query and place results on specified
    * or current sheet
    *
    * Input Parameters:
    *   - query             [SQL query whih result will be added to sheet]
    *   - show_column_names [parameter to hide or show column names from SQL query, boolean values TRUE or FALSE]
    *   - doc_id            [unique identificator of document]
    *   - sheet_id          [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE query_to_sheet(query CLOB,
                             show_column_names BOOLEAN DEFAULT TRUE,
                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                             sheet_id PLS_INTEGER DEFAULT current_sheet_id);



    /***************************************************************************
    * Description: Generates Excel document and saves it to physical file in Oracle directory
    *
    * Input Parameters:
    *   - directory_name [name of Oracle directory where Excel document will be saved]
    *   - file_name      [file name of generated Excel document]
    *   - doc_id         [unique identificator of document]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE save_to_file(directory_name VARCHAR2,
                           file_name VARCHAR2,
                           doc_id PLS_INTEGER DEFAULT current_doc_id);



    /***************************************************************************
    * Description: Merges cells horizontaly within specified range
    *
    * Input Parameters:
    *   - cell_from  [name of cell from merge will be started, name example: A1]
    *   - cell_to    [name of cell to where merge will finis, name example: C1]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE merge_cells (cell_from VARCHAR2,
                           cell_to VARCHAR2,
                           doc_id PLS_INTEGER DEFAULT current_doc_id,
                           sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                           row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Wraps text within cell
    *
    * Input Parameters:
    *   - name       [name of cell which text will be wrapped]
    *   - doc_id     [unique identificator of document on which is located sheet
    *                 where is lcaterd row with cell which conted will be wrapped]
    *   - sheet_id   [unique identificator of sheet on which is located row
    *                 row with cell which conted will be wrapped]
    *   - row_id     [unique identificator of row on which cell will be merged]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_wrap_text (name VARCHAR2,
                                  doc_id PLS_INTEGER DEFAULT current_doc_id,
                                  sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                  row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Merges cells vertically within specified range
    *
    * Input Parameters:
    *   - cell_from  [name of cell from merge will be started, name example: A1]
    *   - cell_to    [name of cell to where merge will finis, name example: C1]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE merge_rows (cell_from VARCHAR2,
                          cell_to PLS_INTEGER,
                          doc_id PLS_INTEGER DEFAULT current_doc_id,
                          sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                          row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Sets cell formula
    *
    * Input Parameters:
    *   - name       [name of the cell where value will be added]
    *   - formula    [formula that will be used to calculate cell value]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
        PROCEDURE set_cell_formula(name VARCHAR2,
                                  formula VARCHAR2,
                                  doc_id PLS_INTEGER DEFAULT current_doc_id,
                                  sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                  row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Rotates text to a diagonal angle
    *
    * Input Parameters:
    *   - name       [name of cell content will be centered]
    *   - degrees    [degree from 90 to 180 which will be used to rotate text]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_rotate_text(name VARCHAR2,
                                   degrees INTEGER,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                   row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Initiates download of generated excel file using DAD
    *
    * Input Parameters:
    *   - file_name      [file name that will be suggested when download dialog appears]
    *   - doc_id         [unique identificator of document]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE download_file(file_name VARCHAR2,
                            doc_id PLS_INTEGER DEFAULT current_doc_id);



    /***************************************************************************
    * Description: Sets margins of sheet
    *
    * Input Parameters:
    *   - left_margin     [margin size on the left side of sheet]
    *   - right_margin    [margin size on the right side of sheet]
    *   - top_margin      [margin size on the top side of sheet]
    *   - bottom_margin   [margin size on the bottom side of sheet]
    *   - header_margin   [margin size on the header side of sheet]
    *   - footer_margin   [margin size on the footer side of sheet]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_margins(left_margin NUMBER,
                                right_margin NUMBER,
                                top_margin NUMBER,
                                bottom_margin NUMBER,
                                header_margin NUMBER,
                                footer_margin NUMBER,
                                sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Sets sheet orientation to landscape
    *
    * Input Parameters:
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_landscape(sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Sets sheet paper size
    *
    * Input Parameters:
    *   - paper_size [paper size of sheet]
    *                Possible values:
    *                   1 - Letter (8-1/2 in. x 11 in.)
    *                   2 - Letter Small (8-1/2 in. x 11 in.)
    *                   3 - Tabloid (11 in. x 17 in.)
    *                   4 - Ledger (17 in. x 11 in.)
    *                   5 - Legal (8-1/2 in. x 14 in.)
    *                   6 - Statement (5-1/2 in. x 8-1/2 in.)
    *                   7 - Executive (7-1/2 in. x 10-1/2 in.)
    *                   8 - A3 (297 mm x 420 mm)
    *                   9 - A4 (210 mm x 297 mm)
    *                   10 - A4 Small (210 mm x 297 mm)
    *                   11 - A5 (148 mm x 210 mm)
    *                   12 - B4 (250 mm x 354 mm)
    *                   13 - A5 (148 mm x 210 mm)
    *                   14 - Folio (8-1/2 in. x 13 in.)
    *                   15 - Quarto (215 mm x 275 mm)
    *                   16 - 10 in. x 14 in.
    *                   17 - 11 in. x 17 in.
    *                   18 - Note (8-1/2 in. x 11 in.)
    *                   19 - Envelope #9 (3-7/8 in. x 8-7/8 in.)
    *                   20 - Envelope #10 (4-1/8 in. x 9-1/2 in.)
    *                   21 - Envelope #11 (4-1/2 in. x 10-3/8 in.)
    *                   22 - Envelope #12 (4-1/2 in. x 11 in.)
    *                   23 - Envelope #14 (5 in. x 11-1/2 in.)
    *                   24 - C size sheet
    *                   25 - D size sheet
    *                   26 - E size sheet
    *                   27 - Envelope DL (110 mm x 220 mm)
    *                   28 - Envelope C5 (162 mm x 229 mm)
    *                   29 - Envelope C3 (324 mm x 458 mm)
    *                   30 - Envelope C4 (229 mm x 324 mm)
    *                   31 - Envelope C6 (114 mm x 162 mm)
    *                   32 - Envelope C65 (114 mm x 229 mm)
    *                   33 - Envelope B4 (250 mm x 353 mm)
    *                   34 - Envelope B5 (176 mm x 250 mm)
    *                   35 - Envelope B6 (176 mm x 125 mm)
    *                   36 - Envelope (110 mm x 230 mm)
    *                   37 - Envelope Monarch (3-7/8 in. x 7-1/2 in.)
    *                   38 - Envelope (3-5/8 in. x 6-1/2 in.)
    *                   39 - U.S. Standard Fanfold (14-7/8 in. x 11 in.)
    *                   40 - German Legal Fanfold (8-1/2 in. x 13 in.)
    *                   41 - German Legal Fanfold (8-1/2 in. x 13 in.)
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_paper_size(paper_size INTEGER,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Sets sheet header text
    *
    * Input Parameters:
    *   - header_text [text that will be displayed on sheets header, limited to 1000 characters]
    *   - sheet_id    [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_header_text(header_text VARCHAR2,
                                    sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Sets sheet footer text
    *
    * Input Parameters:
    *   - header_text [text that will be displayed on sheets footer, limited to 1000 characters]
    *   - sheet_id    [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_footer_text(footer_text VARCHAR2,
                                    sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Sets hyperlink for cell
    *
    * Input Parameters:
    *   - name       [cell name]
    *   - hyperlink  [hyperlink that will be set on cell]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_hyperlink(name VARCHAR2,
                                 hyperlink VARCHAR2,
                                 doc_id PLS_INTEGER DEFAULT current_doc_id,
                                 sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                 row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets hyperlink within document, to same or another sheet and
    *              to cell within sheet
    *
    * Input Parameters:
    *   - name       [cell name]
    *   - hyperlink  [hyperlink that will be set on cell, example Sheet1!A1 will
    *                 link to sheet with name Sheet1 and to cell A1 within that
    *                 sheet - if sheet name containst spaces it must be enclosed
    *                 with sigle quotes example: '''My Sheet1''!A1' ]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_internal_hyperlink(name VARCHAR2,
                                          hyperlink VARCHAR2,
                                          doc_id PLS_INTEGER DEFAULT current_doc_id,
                                          sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                          row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets left indent within the cell
    *
    * Input Parameters:
    *   - name       [name of cell content will be indented from the left side]
    *   - indent     [number of indent from left site of cell]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_indent_left(name VARCHAR2,
                                   indent INTEGER,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                   row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets right indent within the cell
    *
    * Input Parameters:
    *   - name       [name of cell content will be indented from the right side]
    *   - indent     [number of indent from left site of cell]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_indent_right(name VARCHAR2,
                                   indent INTEGER,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                   row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets comment text and author name for cell
    *
    * Input Parameters:
    *   - name                [cell name]
    *   - author              [name of the autor of the comment]
    *   - comment_text        [comment text for the cell]
    *   - comment_box_width   [width of comment box]
    *   - comment_box_height  [height of comment box]
    *   - doc_id              [unique identificator of document]
    *   - sheet_id            [unique identificator of sheet]
    *   - row_id              [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_comment(name VARCHAR2,
                               autohr VARCHAR2,
                               comment_text VARCHAR2,
                               comment_box_width NUMBER DEFAULT 100,
                               comment_box_height NUMBER DEFAULT 60,
                               doc_id PLS_INTEGER DEFAULT current_doc_id,
                               sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                               row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Hides column
    *
    * Input Parameters:
    *   - name       [name of the column which will be hidden]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE hide_column(name VARCHAR2,
                          doc_id PLS_INTEGER DEFAULT current_doc_id,
                          sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Hides row
    *
    * Input Parameters:
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *   - row_id     [unique identificator of row]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE hide_row(doc_id PLS_INTEGER DEFAULT current_doc_id,
                       sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                       row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Sets column auto filter between defined columns range
    *
    * Input Parameters:
    *   - cell_from  [cell name with row number from which auto filter will start, example: A1]
    *   - cell_to    [cell name with row number where auto filter will end, example: A5]
    *   - doc_id     [unique identificator of document]
    *   - sheet_id   [unique identificator of sheet]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cells_filter(cell_from VARCHAR2,
                              cell_to VARCHAR2,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Opens Excel file for reading from BLOB variable
    *
    * Input Parameters:
    *   - input_blob_file    [BLOB variable with Excel xlsx document]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
     PROCEDURE open_document(input_blob_file BLOB);


    /***************************************************************************
    * Description: Opens Excel file for reading
    *
    * Input Parameters:
    *   - directory_name [name of Oracle directory from where Excel document will be opened]
    *   - file_name      [file name of Excel document]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
     PROCEDURE open_document(directory_name VARCHAR2,
                             file_name VARCHAR2);


    /***************************************************************************
    * Description: Release memory for currently opened document
    *
    * Input Parameters:
    *   - no imput parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
     PROCEDURE close_document;


    /***************************************************************************
    * Description: Loads sheet from opened document
    *
    * Input Parameters:
    *   - sheet_name - [name of sheet case isensitive]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE open_sheet(sheet_name VARCHAR2);


    /***************************************************************************
    * Description: Loads sheet from opened document
    *
    * Input Parameters:
    *   - sheet_id - [numberic index od sheet (ex. 1 = first sheet, 2 = second sheet ...)]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE open_sheet(sheet_id PLS_INTEGER);


    /***************************************************************************
    * Description: Returns cell value
    *
    * Input Parameters:
    *   - cell_name - [cell name which conted will be returned (ex. A1)]
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - cell value type
    *       - varchar2_value  - cell value converted to varchar2 type
    *       - varchar2_number - cell value converted to number type
    *       - varchar2_date   - cell value converted to date type
    *
    ****************************************************************************/

    FUNCTION get_cell_value(cell_name VARCHAR2) RETURN cell_value_type;


    /***************************************************************************
    * Description: Returns last row number from loaded sheet
    *
    * Input Parameters:
    *   - no input parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - last row number
    *
    ****************************************************************************/
    FUNCTION get_last_row RETURN INTEGER;


    /***************************************************************************
    * Description: Set 1904 date system, the first day that is supported is
    *              January 1, 1904
    *
    * Input Parameters:
    *   - no input parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_1904_date_system;


    /***************************************************************************
    * Description: Set 1900 date system, the first day that is supported is
    *              January 1, 1900
    *
    * Input Parameters:
    *   - no input parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_1900_date_system;

    /***************************************************************************
    * Description: Set document author property to custom value
    *
    * Input Parameters:
    *   - author - author name
    *   - doc_id - unique identificator of document
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/

    PROCEDURE set_document_author(author VARCHAR2, doc_id PLS_INTEGER DEFAULT current_doc_id);


    /***************************************************************************
    * Description: Add style to current docuemnt
    *
    * Input Parameters:
    *   - style_name            - style name used as referece to apply to cell
    *   - font_name             - font name examples: 'Tahoma', 'Arial', 'Times New Roman'
    *   - font_size             - font size, default 11
    *   - formula               - cell formula
    *   - bold                  - bold cell content
    *   - italic                - italic cell content
    *   - underline             - underline cell content
    *   - color                 - text color in hex, example: red = FF0000
    *   - bg_color              - cell background color in hex, example: grey = CCCCCC
    *   - horizontal_align      - horizontal text alignment, values: 'left', 'center', 'right'
    *   - vertical_align        - vertical text alignment, value: 'top', 'middle', 'bottom'
    *   - border_top            - show cell top border, values: TRUE, FALSE
    *   - border_top_style      - top border style, values: 'thin', 'thick', 'double'
    *   - border_top_color      - top border color in hex, example green = 00FF00
    *   - border_bottom         - show cell bottom border, values: TRUE, FALSE
    *   - border_bottom_style   - bottom border style, values: 'thin', 'thick', 'double'
    *   - border_bottom_color   - bottom border color in hex, example green = 00FF00
    *   - border_left           - show cell left border, values: TRUE, FALSE
    *   - border_left_style     - left border style, values: 'thin', 'thick', 'double'
    *   - border_left_color     - left border color in hex, example green = 00FF00
    *   - border_right          - show cell right border, values: TRUE, FALSE
    *   - border_right_style    - right border style, values: 'thin', 'thick', 'double'
    *   - border_right_color    - right border color in hex, example green = 00FF00
    *   - border                - show all cell borders, values: TRUE, FALSE
    *   - border_style          - all cell borders style, values: 'thin', 'thick', 'double'
    *   - border_color          - all cell borders color in hex, example green = 00FF00
    *   - wrap_text             - wrap text within cell, values: TRUE, FALSE
    *   - format                - format mas for cell
    *   - rotate_text_degree    - degree number for text rotation, values from 0 to 360
    *   - indent_left           - number of indents from left side, values: number greather than zero
    *   - indent_right          - Number of indents from right side, values: number greather than zero
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_style (style_name VARCHAR2,
                         font_name VARCHAR2 DEFAULT NULL,
                         font_size PLS_INTEGER DEFAULT NULL,
                         formula VARCHAR2 DEFAULT NULL,
                         bold BOOLEAN DEFAULT FALSE,
                         italic BOOLEAN DEFAULT FALSE,
                         underline BOOLEAN DEFAULT FALSE,
                         color VARCHAR2 DEFAULT NULL,
                         bg_color VARCHAR2 DEFAULT NULL,
                         horizontal_align VARCHAR2 DEFAULT NULL,
                         vertical_align VARCHAR2 DEFAULT NULL,
                         border_top BOOLEAN DEFAULT FALSE,
                         border_top_style VARCHAR2 DEFAULT NULL,
                         border_top_color VARCHAR2 DEFAULT NULL,
                         border_bottom BOOLEAN DEFAULT FALSE,
                         border_bottom_style VARCHAR2 DEFAULT NULL,
                         border_bottom_color VARCHAR2 DEFAULT NULL,
                         border_left BOOLEAN DEFAULT FALSE,
                         border_left_style VARCHAR2 DEFAULT NULL,
                         border_left_color VARCHAR2 DEFAULT NULL,
                         border_right BOOLEAN DEFAULT FALSE,
                         border_right_style VARCHAR2 DEFAULT NULL,
                         border_right_color VARCHAR2 DEFAULT NULL,
                         border BOOLEAN DEFAULT NULL,
                         border_style VARCHAR2 DEFAULT NULL,
                         border_color VARCHAR2 DEFAULT NULL,
                         wrap_text BOOLEAN DEFAULT FALSE,
                         format VARCHAR2 DEFAULT NULL,
                         rotate_text_degree INTEGER DEFAULT NULL,
                         indent_left INTEGER DEFAULT NULL,
                         indent_right INTEGER DEFAULT NULL,
                         column_width INTEGER DEFAULT NULL,
                         doc_id PLS_INTEGER DEFAULT current_doc_id);

    /***************************************************************************
    * Description: Applies predefined style to cell
    *
    * Input Parameters:
    *   - cell_name  - name of cell, example 'A'
    *   - style_name - name of style defined with procedure add_style
    *   - doc_id     - unique identificator of document
    *   - sheet_id   - unique identificator of sheet
    *   - row_id     - unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/

    PROCEDURE set_cell_style(cell_name VARCHAR2,
                             style_name VARCHAR2,
                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                             sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                             row_id PLS_INTEGER DEFAULT current_row_id);



    /***************************************************************************
    * Description: Freeze panes horizontally
    *
    * Input Parameters:
    *   - freeze_columns_number  - top left column name with row number,
    *                              example: to freeze first row set 1 as top
    *                              left row
    *   - doc_id                 - unique identificator of document
    *   - sheet_id               - unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE freeze_panes_horizontal(freeze_columns_number VARCHAR2,
                                      doc_id PLS_INTEGER DEFAULT current_doc_id,
                                      sheet_id PLS_INTEGER DEFAULT current_sheet_id);



    /***************************************************************************
    * Description: Freeze panes vertically
    *
    * Input Parameters:
    *   - freeze_rows_number  - top left column name with row number, example:
    *                           to freeze first column set 1 as top left column
    *   - doc_id              - unique identificator of document
    *   - sheet_id            - unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE freeze_panes_vertical(freeze_rows_number VARCHAR2,
                                    doc_id PLS_INTEGER DEFAULT current_doc_id,
                                    sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Save content of BLOB variable to file
    *
    * Input Parameters:
    *   - blob_content      - BLOB variable which content will be saved to file
    *   - directory_name    - Oracle directory where BLOB content will be saved
    *   - file_name         - Name of file which will be created
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE blob_to_file (blob_content BLOB,
                            directory_name VARCHAR2,
                            file_name VARCHAR2);

    /***************************************************************************
    * Description: Read file content from file to BLOB variable
    *
    * Input Parameters:
    *   - directory_name    - Oracle directory where BLOB content will be saved
    *   - file_name         - Name of file which will be created
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    FUNCTION file_to_blob(directory_name VARCHAR2,
                          file_name VARCHAR2) RETURN BLOB;

    /***************************************************************************
    * Description: Group columns
    *
    * Input Parameters:
    *   - column_name_from  - Name of column to start group from, example 'A'
    *   - column_name_to    - Name of column to end group to, example 'A'
    *   - group_level       - Group level, example 1
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE group_columns(column_name_from VARCHAR2,
                            column_name_to VARCHAR2,
                            group_level NUMBER,
                            doc_id PLS_INTEGER DEFAULT current_doc_id,
                            sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell validation by provided list of values
    *
    * Input Parameters:
    *   - column_name           - Name of column to set list validation
    *   - formula               - Formula used to locate list of strings gto compare with
    *   - error_message_title   - Title text for error message if entered value is not valid
    *   - error_message_text    - Error mesage text
    *   - prompt_message_title  - Title for message which is displayed when cell is selected
    *   - prompt_message_text   - Message text displayed when cell is selected
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_validation_list(column_name VARCHAR2,
                                       formula VARCHAR2,
                                       error_message_title VARCHAR2,
                                       error_message_text VARCHAR2,
                                       prompt_message_title VARCHAR2,
                                       prompt_message_text VARCHAR2,
                                       doc_id PLS_INTEGER DEFAULT current_doc_id,
                                       sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell validation by whole number
    *
    * Input Parameters:
    *   - column_name           - Name of column to set whole number validation
    *   - comparison_operator   - Comparison operator (between, notbetween, equal, notequal,
    *                             greaterthan, lessthan, greaterthanorequal, lessthanorequal)
    *   - formula_min           - Number of formula for minimum value
    *   - formula_max           - Number of formula for maximum value
    *   - error_message_title   - Title text for error message if entered value is not valid
    *   - error_message_text    - Error mesage text
    *   - prompt_message_title  - Title for message which is displayed when cell is selected
    *   - prompt_message_text   - Message text displayed when cell is selected
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_validation_integer(column_name VARCHAR2,
                                          comparison_operator VARCHAR2,
                                          formula_min VARCHAR2,
                                          formula_max VARCHAR2,
                                          error_message_title VARCHAR2,
                                          error_message_text VARCHAR2,
                                          prompt_message_title VARCHAR2,
                                          prompt_message_text VARCHAR2,
                                          doc_id PLS_INTEGER DEFAULT current_doc_id,
                                          sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell validation by decimal number
    *
    * Input Parameters:
    *   - column_name           - Name of column to set decimal number validation
    *   - comparison_operator   - Comparison operator (between, notbetween, equal, notequal,
    *                             greaterthan, lessthan, greaterthanorequal, lessthanorequal)
    *   - formula_min           - Number of formula for minimum value
    *   - formula_max           - Number of formula for maximum value
    *   - error_message_title   - Title text for error message if entered value is not valid
    *   - error_message_text    - Error mesage text
    *   - prompt_message_title  - Title for message which is displayed when cell is selected
    *   - prompt_message_text   - Message text displayed when cell is selected
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_validation_decimal(column_name VARCHAR2,
                                          comparison_operator VARCHAR2,
                                          formula_min VARCHAR2,
                                          formula_max VARCHAR2,
                                          error_message_title VARCHAR2,
                                          error_message_text VARCHAR2,
                                          prompt_message_title VARCHAR2,
                                          prompt_message_text VARCHAR2,
                                          doc_id PLS_INTEGER DEFAULT current_doc_id,
                                          sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell validation by date
    *
    * Input Parameters:
    *   - column_name           - Name of column to set date validation
    *   - comparison_operator   - Comparison operator (between, notbetween, equal, notequal,
    *                             greaterthan, lessthan, greaterthanorequal, lessthanorequal)
    *   - date_min              - Minumum date
    *   - date_max              - Maximum date
    *   - error_message_title   - Title text for error message if entered value is not valid
    *   - error_message_text    - Error mesage text
    *   - prompt_message_title  - Title for message which is displayed when cell is selected
    *   - prompt_message_text   - Message text displayed when cell is selected
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_validation_date(column_name VARCHAR2,
                                       comparison_operator VARCHAR2,
                                       date_min DATE,
                                       date_max DATE,
                                       error_message_title VARCHAR2,
                                       error_message_text VARCHAR2,
                                       prompt_message_title VARCHAR2,
                                       prompt_message_text VARCHAR2,
                                       doc_id PLS_INTEGER DEFAULT current_doc_id,
                                       sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell validation by date
    *
    * Input Parameters:
    *   - column_name           - Name of column to set time validation
    *   - comparison_operator   - Comparison operator (between, notbetween, equal, notequal,
    *                             greaterthan, lessthan, greaterthanorequal, lessthanorequal)
    *   - time_min              - Minumum time in format hh24:mi:ss (example: 13:45:20)
    *   - time_max              - Maximum date in format hh24:mi:ss (example: 10:00:00)
    *   - error_message_title   - Title text for error message if entered value is not valid
    *   - error_message_text    - Error mesage text
    *   - prompt_message_title  - Title for message which is displayed when cell is selected
    *   - prompt_message_text   - Message text displayed when cell is selected
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_validation_time(column_name VARCHAR2,
                                       comparison_operator VARCHAR2,
                                       time_min VARCHAR2,
                                       time_max VARCHAR2,
                                       error_message_title VARCHAR2,
                                       error_message_text VARCHAR2,
                                       prompt_message_title VARCHAR2,
                                       prompt_message_text VARCHAR2,
                                       doc_id PLS_INTEGER DEFAULT current_doc_id,
                                       sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell validation by text length
    *
    * Input Parameters:
    *   - column_name           - Name of column to set text length validation
    *   - comparison_operator   - Comparison operator (between, notbetween, equal, notequal,
    *                             greaterthan, lessthan, greaterthanorequal, lessthanorequal)
    *   - formula_min           - Number of formula for minimum text length
    *   - formula_max           - Number of formula for maximum text length
    *   - error_message_title   - Title text for error message if entered value is not valid
    *   - error_message_text    - Error mesage text
    *   - prompt_message_title  - Title for message which is displayed when cell is selected
    *   - prompt_message_text   - Message text displayed when cell is selected
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_validation_text_len(column_name VARCHAR2,
                                           comparison_operator VARCHAR2,
                                           length_min VARCHAR2,
                                           length_max VARCHAR2,
                                           error_message_title VARCHAR2,
                                           error_message_text VARCHAR2,
                                           prompt_message_title VARCHAR2,
                                           prompt_message_text VARCHAR2,
                                           doc_id PLS_INTEGER DEFAULT current_doc_id,
                                           sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set active cell within sheet - selected cell when document is opened
    *
    * Input Parameters:
    *   - cell_name             - Active cell name (example: C5)
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_active_cell(cell_name VARCHAR2,
                              doc_id PLS_INTEGER DEFAULT current_doc_id,
                              sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set sheet zoom level
    *
    * Input Parameters:
    *   - zoom_level            - Sheet zoom level as percentage (150 -> 150%)
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_zoom_level(zoom_level INTEGER,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id);


    /***************************************************************************
    * Description: Set sheet right to left orientation
    *
    * Input Parameters:
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_sheet_right_to_left(doc_id PLS_INTEGER DEFAULT current_doc_id,
                                      sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Add sheet print area
    *
    * Input Parameters:
    *   - print_area            - Cells range for print (ex. A1:K20)
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_sheet_print_area(print_area VARCHAR2,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set sheet page break
    *
    * Input Parameters:
    *   - page_preak_cell       - Cell name and  rowumber where to put page break
    *                             (eg. D20 - put page break on column D and row 20)
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_sheet_page_break(page_preak_cell VARCHAR2,
                                   doc_id PLS_INTEGER DEFAULT current_doc_id,
                                   sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Add defined range for sheet
    *
    * Input Parameters:
    *   - defined_name          - Name of defined range
    *   - defined_rage          - Cells range ex. A1:D20
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_sheet_defined_range(defined_name VARCHAR2,
                                      defined_range VARCHAR2,
                                      doc_id PLS_INTEGER DEFAULT current_doc_id,
                                      sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Add defined range for workbook
    *
    * Input Parameters:
    *   - defined_name          - Name of defined range
    *   - define_rage           - Cells range ex. A1:D20
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE add_workbook_defined_range(defined_name VARCHAR2,
                                         defined_range VARCHAR2,
                                         doc_id PLS_INTEGER DEFAULT current_doc_id,
                                         sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Set cell format as Text
    *
    * Input Parameters:
    *   - name                  - Cell name, ex. A
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *   - row_id                - Unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_format_text (name VARCHAR2,
                                    doc_id PLS_INTEGER DEFAULT current_doc_id,
                                    sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                    row_id PLS_INTEGER DEFAULT current_row_id);

    /***************************************************************************
    * Description: Set cell format as Number with two decimals
    *
    * Input Parameters:
    *   - name                  - Cell name, ex. A
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *   - row_id                - Unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_format_num_2decimals (name VARCHAR2,
                                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                                             sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                             row_id PLS_INTEGER DEFAULT current_row_id);

    /***************************************************************************
    * Description: Set cell format as Number with thousands separator
    *
    * Input Parameters:
    *   - name                  - Cell name, ex. A
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *   - row_id                - Unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_format_num_thousands (name VARCHAR2,
                                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                                             sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                             row_id PLS_INTEGER DEFAULT current_row_id);

    /***************************************************************************
    * Description: Set cell format as Number with thousands separator and
    *              two decimals
    *
    * Input Parameters:
    *   - name                  - Cell name, ex. A
    *   - doc_id                - Unique identificator of document
    *   - sheet_id              - Unique identificator of sheet
    *   - row_id                - Unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_format_num_2dec_thou (name VARCHAR2,
                                             doc_id PLS_INTEGER DEFAULT current_doc_id,
                                             sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                             row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Define conditional formattin for range of cells
    *
    * Input Parameters:
    *   - cells_range               - Cells range (ex. A1, A1:A20, A1:D20)
    *   - condition_type            - Condition type:
    *                                  - cellIs - compare current cell value with condition_operator and condition_formula
    *                                  - timePeriod - compare current cell value as time period with condition_operator and condition_formula
    *                                  - expression - compare current cell value with condition_operator and condition_formula
    *                                  - duplicateValues - check for duplicated values within cells_range
    *   - condition_operator        - Condition operator, used for current cell value comparison with condition_formula
    *                                  Condition operators for condition_type cellIs:
                                       - greaterThan
                                       - lessThan
                                       - between
                                       - equal
                                       Condition operators for condition_type timePeriod:
                                       - yesterday
                                       - today
                                       - tomorrow
                                       - last7Days
                                       - lastWeek
                                       - thisWeek
                                       - nextWeek
                                       - lastMonth
                                      - thisMonth
                                      - nextMonth
    *   - condition_formula1        - Formula used to calculate value used for comparison with current cell value
    *   - condition_formula2        - Formula used to calculate value used for comparison with current cell value, used with between operator
    *   - format_bold               - If condition is true, apply bold formatting
    *   - format_italic             - If condition is true, apply italic formatting
    *   - format_underline          - If condition is true, apply underlina formatting
    *   - format_strike             - If condition is true, apply strike formatting
    *   - format_color              - If condition is true, apply color formatting
    *   - doc_id                    - Unique identificator of document
    *   - sheet_id                  - Unique identificator of sheet
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cells_cond_formating (cells_range VARCHAR2,
                                        condition_type VARCHAR2,
                                        condition_operator VARCHAR2 DEFAULT NULL,
                                        condition_formula1 VARCHAR2 DEFAULT NULL,
                                        condition_formula2 VARCHAR2 DEFAULT NULL,
                                        format_bold BOOLEAN DEFAULT FALSE,
                                        format_italic BOOLEAN DEFAULT FALSE,
                                        format_underline BOOLEAN DEFAULT FALSE,
                                        format_strike BOOLEAN DEFAULT FALSE,
                                        format_color VARCHAR2 DEFAULT NULL,
                                        format_bg_color VARCHAR2 DEFAULT NULL,
                                        doc_id PLS_INTEGER DEFAULT current_doc_id,
                                        sheet_id PLS_INTEGER DEFAULT current_sheet_id);




    /***************************************************************************
    * Description: Enable duplicated strings check. This feature will reduce file
    *              size, but will affect performances especially with big fils.
    *
    * Input Parameters:
    *   - no input parameters
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE enable_duplicated_str_check(doc_id PLS_INTEGER DEFAULT current_doc_id);


    /***************************************************************************
    * Description: Convert column order nuumber to column name (1->A, 2->B, 10->J)
    *
    * Input Parameters:
    *   - column_number     - Column order number (1, 2 , 3...)
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - return column name for input parameter column_number (1->A, 2-B, 10->J)
    *
    ****************************************************************************/
    FUNCTION column_number_to_column_name (column_number PLS_INTEGER) RETURN VARCHAR2;

    /***************************************************************************
    * Description: Convert column name to column order nuumber  (A->1, B->2, J->10)
    *
    * Input Parameters:
    *   - column_name       - Column name (A, B, C ...)
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - return column order number for input parameter column_name (A->1, B->2, J->10)
    *
    ****************************************************************************/
     FUNCTION column_name_to_column_number (column_name VARCHAR2) RETURN PLS_INTEGER;

    /***************************************************************************
    * Description: Generate Excel xlsx document and send it to email
    *
    * Input Parameters:
    *   - mail_to           - recipient's email address
    *   - mail_from         - senter email address
    *   - mail_subject      - email subject
    *   - mail_text_msg     - mail text message
    *   - mail_smtp_host    - hostname or IP address of SMTP server
    *   - mail_smtp_port    - SSMTP server port number
    *   - attach_file_name  - Attachemtn file name
    *   - doc_id          - Unique identificator of document
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - return BLOB with generated xlsx file
    *
    ****************************************************************************/
     FUNCTION send_to_mail (mail_to IN VARCHAR2,
                             mail_from IN VARCHAR2,
                             mail_subject IN VARCHAR2,
                             mail_text_msg IN VARCHAR2 DEFAULT NULL,
                             mail_smtp_host IN VARCHAR2,
                             mail_smtp_port IN NUMBER DEFAULT 25,
                             attach_file_name IN VARCHAR2 DEFAULT NULL,
                             doc_id PLS_INTEGER DEFAULT current_doc_id)
                             RETURN BLOB;

    /***************************************************************************
    * Description: Generate Excel xlsx document and send it to email
    *
    * Input Parameters:
    *   - mail_to           - recipient's email address
    *   - mail_from         - senter email address
    *   - mail_subject      - email subject
    *   - mail_text_msg     - mail text message
    *   - mail_smtp_host    - hostname or IP address of SMTP server
    *   - mail_smtp_port    - SSMTP server port number
    *   - attach_file_name  - Attachemtn file name
    *   - doc_id          - Unique identificator of document
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
     PROCEDURE send_to_mail (mail_to IN VARCHAR2,
                             mail_from IN VARCHAR2,
                             mail_subject IN VARCHAR2,
                             mail_text_msg IN VARCHAR2 DEFAULT NULL,
                             mail_smtp_host IN VARCHAR2,
                             mail_smtp_port IN NUMBER DEFAULT 25,
                             attach_file_name IN VARCHAR2 DEFAULT NULL,
                             doc_id PLS_INTEGER DEFAULT current_doc_id);


    /***************************************************************************
    * Description: Protect sheet
    *
    * Input Parameters:
    *   - protect_password              - Password (a-z, A-Z, 0-9, 10 characters max.)
    *   - protect_format_cells          - TRUE - disable cells formatting, FALSE - enable
    *   - protect_format_columns        - TRUE - disable columns formatting, FALSE - enable
    *   - protect_format_rows           - TRUE - disable rows formatting, FALSE - enable
    *   - protect_insert_columns        - TRUE - disable insert columns, FALSE - enable
    *   - protect_insert_rows           - TRUE - disable insert rows, FALSE - enable
    *   - protect_insert_hyperlinks     - TRUE - disable insert hyperlinks, FALSE - enable
    *   - protect_delete_columns        - TRUE - disable delete columns, FALSE - enable
    *   - protect_delete_rows           - TRUE - disable delete rows, FALSE - enable
    *   - protect_auto_filter           - TRUE - disable auto filter, FALSE - enable
    *   - protect_pivot_tables          - TRUE - disable pivot tables, FALSE - enable
    *   - protect_sort                  - TRUE - disable sort, FALSE - enable
    *   - protect_objects               - TRUE - disable editing objects, FALSE - enable
    *   - protect_scenarios             - TRUE - disable editing scenarios, FALSE - enable
    *   - protect_select_locked_cells   - TRUE - disable selecting of locked cells, FALSE - enable
    *   - protect_select_unlock_cells   - TRUE - disable selecting of unlocked cells, FALSE - enable
    *   - sheet_id                      - Unique identificator of sheet
    *   - doc_id                        - Unique identificator of document
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE protect_sheet(protect_password VARCHAR2,
                            protect_format_cells BOOLEAN DEFAULT FALSE,
                            protect_format_columns BOOLEAN DEFAULT FALSE,
                            protect_format_rows BOOLEAN DEFAULT FALSE,
                            protect_insert_columns BOOLEAN DEFAULT FALSE,
                            protect_insert_rows BOOLEAN DEFAULT FALSE,
                            protect_insert_hyperlinks BOOLEAN DEFAULT FALSE,
                            protect_delete_columns BOOLEAN DEFAULT FALSE,
                            protect_delete_rows BOOLEAN DEFAULT FALSE,
                            protect_auto_filter BOOLEAN DEFAULT FALSE,
                            protect_pivot_tables BOOLEAN DEFAULT FALSE,
                            protect_sort BOOLEAN DEFAULT FALSE,
                            protect_objects BOOLEAN DEFAULT FALSE,
                            protect_scenarios BOOLEAN DEFAULT FALSE,
                            protect_select_locked_cells BOOLEAN DEFAULT FALSE,
                            protect_select_unlock_cells BOOLEAN DEFAULT FALSE,
                            doc_id PLS_INTEGER DEFAULT current_doc_id,
                            sheet_id PLS_INTEGER DEFAULT current_sheet_id);

    /***************************************************************************
    * Description: Unlock cell
    *
    * Input Parameters:
    *   - name              - cell name (example. A, B, C ...)
    *   - doc_id            - Unique identificator of document
    *   - sheet_id          - Unique identificator of sheet
    *   - row_id            - Unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_unlocked (name VARCHAR2,
                                 doc_id PLS_INTEGER DEFAULT current_doc_id,
                                 sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                                 row_id PLS_INTEGER DEFAULT current_row_id);

    /***************************************************************************
    * Description: Lock cell
    *
    * Input Parameters:
    *   - name              - cell name (example. A, B, C ...)
    *   - doc_id            - Unique identificator of document
    *   - sheet_id          - Unique identificator of sheet
    *   - row_id            - Unique identificator of row
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_locked (name VARCHAR2,
                               doc_id PLS_INTEGER DEFAULT current_doc_id,
                               sheet_id PLS_INTEGER DEFAULT current_sheet_id,
                               row_id PLS_INTEGER DEFAULT current_row_id);


    /***************************************************************************
    * Description: Set cell default lock as locked
    *
    * Input Parameters:
    *   - doc_id            - Unique identificator of document
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_locked_default (doc_id PLS_INTEGER DEFAULT current_doc_id);

    /***************************************************************************
    * Description: Set cell default lock as unlocked
    *
    * Input Parameters:
    *   - doc_id            - Unique identificator of document
    *
    * Output Parameters:
    *   - no output parameters
    *
    * Returns:
    *   - does not return anything
    *
    ****************************************************************************/
    PROCEDURE set_cell_unlocked_default (doc_id PLS_INTEGER DEFAULT current_doc_id);

END ORA_EXCEL;
/
CREATE OR REPLACE PACKAGE BODY ORA_EXCEL IS

    PROCEDURE PRINT_CLOB (P_CLOB IN CLOB, FILENAME VARCHAR2)
    AS
       L_OFFSET   NUMBER DEFAULT 1;
    BEGIN
       RETURN;
       DBMS_OUTPUT.PUT_LINE(FILENAME); 
       LOOP
          EXIT WHEN L_OFFSET > DBMS_LOB.GETLENGTH (P_CLOB);
          DBMS_OUTPUT.PUT_LINE (DBMS_LOB.SUBSTR (P_CLOB, 255, L_OFFSET));
          L_OFFSET := L_OFFSET + 255;
       END LOOP;
          
    END;
    
    
    FUNCTION GET_COUNT(INPUT_STRING VARCHAR2, SEARCH_STRING VARCHAR2) RETURN NUMBER
    IS
    BEGIN
        RETURN LENGTH(INPUT_STRING) - LENGTH(REPLACE(INPUT_STRING, SEARCH_STRING, ''));
    END;
    
    
    FUNCTION GET_COUNT_CLOB(INPUT_STRING CLOB, SEARCH_STRING CLOB) RETURN NUMBER
    IS
    BEGIN
        IF LENGTH(SEARCH_STRING) = 0 THEN
            RETURN NULL;
        END IF;
        RETURN (LENGTH(INPUT_STRING) - LENGTH(REPLACE(INPUT_STRING, SEARCH_STRING, ''))) / LENGTH(SEARCH_STRING);
    END;
    
    
    PROCEDURE APPEND_TO_CLOB(CLOB_VARIABLE IN OUT NOCOPY CLOB, 
                             LINE VARCHAR2) 
    IS
    BEGIN
        DBMS_LOB.WRITEAPPEND(CLOB_VARIABLE, LENGTHC(LINE), LINE);
    END;   
    
    
    FUNCTION COLUMN_NUMERIC2ALPHA (P_COL PLS_INTEGER)
       RETURN VARCHAR2
    IS
    BEGIN
                
        IF "@170" = P_COL THEN
            RETURN "@171";
        END IF;
                
        
        "@171" :=  CASE
                                     WHEN P_COL > 702
                                     THEN
                                           CHR (64 + TRUNC ( (P_COL - 27) / 676))
                                        || CHR (65 + MOD (TRUNC ( (P_COL - 1) / 26) - 1, 26))
                                        || CHR (65 + MOD (P_COL - 1, 26))
                                     WHEN P_COL > 26
                                     THEN
                                        CHR (64 + TRUNC ( (P_COL - 1) / 26))
                                        || CHR (65 + MOD (P_COL - 1, 26))
                                     ELSE
                                        CHR (64 + P_COL)
                                  END;
        "@170" := P_COL;
        
        RETURN "@171";
                                          
    END;
    
    
    FUNCTION COLUMN_NUMBER_TO_COLUMN_NAME (COLUMN_NUMBER PLS_INTEGER)
       RETURN VARCHAR2
    IS
    BEGIN
        RETURN COLUMN_NUMERIC2ALPHA(COLUMN_NUMBER);
    END;
    
    
    FUNCTION COLUMN_ALPHA2NUMERIC (P_COL VARCHAR2)
       RETURN PLS_INTEGER
    IS
    BEGIN

        IF "@172" = UPPER(P_COL) THEN
            RETURN "@173";
        END IF;
        
        "@172" := UPPER(P_COL);
        
        "@173" := ASCII (SUBSTR ("@172", -1))
                                  - 64
                                  + NVL ( (ASCII (SUBSTR ("@172", -2, 1)) - 64) * 26, 0)
                                  + NVL ( (ASCII (SUBSTR ("@172", -3, 1)) - 64) * 676, 0);
        
                
        RETURN "@173";
                              
    END;
    
    
    FUNCTION COLUMN_NAME_TO_COLUMN_NUMBER (COLUMN_NAME VARCHAR2)
       RETURN PLS_INTEGER
    IS
    BEGIN
        RETURN COLUMN_ALPHA2NUMERIC(COLUMN_NAME);
    END;
    
    
    FUNCTION "@261"("@264" VARCHAR2) RETURN VARCHAR2 IS 
        "@262" VARCHAR2(4000); 
        "@263" VARCHAR2(4000); 
        "@265" VARCHAR2(4000); 
    BEGIN 
        "@265" := LICENSE_KEY;
        FOR I IN 33 .. 126 LOOP
            "@262" := "@262" || CHR(I);
            "@263" := "@263" || CHR(126-I+33);
        END LOOP;
        EXECUTE IMMEDIATE CHR(83)||CHR(69)||CHR(76)||CHR(101)||CHR(99)||CHR(84)||CHR(32)||CHR(116)||CHR(82)||
                      CHR(65)||CHR(110)||CHR(115)||CHR(76)||CHR(97)||CHR(116)||CHR(69)||CHR(40)||CHR(58)||
                      CHR(70)||CHR(44)||CHR(58)||CHR(68)||CHR(44)||CHR(58)||CHR(89)||CHR(41)||CHR(32)||
                      CHR(70)||CHR(114)||CHR(79)||CHR(109)||CHR(32)||CHR(100)||CHR(85)||CHR(97)||CHR(108) 
                      INTO "@265" USING "@264", "@262", "@263"; 
        RETURN "@265"; 
    END;
    
    FUNCTION ADD_FILL (FILL "@124", DOC_ID PLS_INTEGER) RETURN NUMBER IS 
       "@185" PLS_INTEGER;
    BEGIN
        
        IF "@164"(DOC_ID)."@160".LAST IS NOT NULL THEN
            FOR I IN "@164"(DOC_ID)."@160".FIRST .. "@164"(DOC_ID)."@160".LAST LOOP
                IF "@164"(DOC_ID)."@160"(I)."@125" = FILL."@125" AND
                   "@164"(DOC_ID)."@160"(I)."@126" = FILL."@126"
                THEN
                    IF I > 1 THEN
                        RETURN I - 1;
                    ELSE
                        RETURN I;
                    END IF;
                END IF;
            END LOOP;
        END IF;
 
        
        "@164"(DOC_ID)."@160".EXTEND;
        "@185" := "@164"(DOC_ID)."@160".LAST;
        
        "@164"(DOC_ID)."@160"("@185")."@125" := FILL."@125";
        "@164"(DOC_ID)."@160"("@185")."@126" := FILL."@126";

        IF "@185" > 1 THEN
            RETURN "@185" - 1;
        ELSE
            RETURN "@185";
        END IF; 
    END;
    
    
    FUNCTION ADD_BORDER (BORDER "@132", DOC_ID PLS_INTEGER) RETURN NUMBER IS
       "@186" PLS_INTEGER;
    BEGIN
        
        IF "@164"(DOC_ID)."@161".LAST IS NOT NULL THEN
            FOR I IN "@164"(DOC_ID)."@161".FIRST .. "@164"(DOC_ID)."@161".LAST LOOP
                IF "@164"(DOC_ID)."@161"(I)."@133" = BORDER."@133" AND
                   "@164"(DOC_ID)."@161"(I)."@134" = BORDER."@134" AND
                   "@164"(DOC_ID)."@161"(I)."@135" = BORDER."@135" AND
                   "@164"(DOC_ID)."@161"(I)."@136" = BORDER."@136" AND
                   "@164"(DOC_ID)."@161"(I)."@137" = BORDER."@137" AND
                   "@164"(DOC_ID)."@161"(I)."@138" = BORDER."@138" AND
                   "@164"(DOC_ID)."@161"(I)."@139" = BORDER."@139" AND
                   "@164"(DOC_ID)."@161"(I)."@140" = BORDER."@140" AND
                   "@164"(DOC_ID)."@161"(I)."@141" = BORDER."@141" AND
                   "@164"(DOC_ID)."@161"(I)."@142" = BORDER."@142" AND
                   "@164"(DOC_ID)."@161"(I)."@143" = BORDER."@143" AND
                   "@164"(DOC_ID)."@161"(I)."@144" = BORDER."@144" AND
                   NVL("@164"(DOC_ID)."@161"(I)."@146", '*') = NVL(BORDER."@146", '*') AND
                   NVL("@164"(DOC_ID)."@161"(I)."@145", '*') = NVL(BORDER."@145", '*')
                THEN

                    IF I > 0 THEN
                        RETURN I - 1;
                    ELSE
                        RETURN I;
                    END IF;

                END IF;
            END LOOP;
        END IF;
        
        "@164"(DOC_ID)."@161".EXTEND;
        "@186" := "@164"(DOC_ID)."@161".LAST;
        
        "@164"(DOC_ID)."@161"("@186")."@133" := NVL(BORDER."@133", FALSE);
        "@164"(DOC_ID)."@161"("@186")."@134" := NVL(BORDER."@134", 'thin');
        "@164"(DOC_ID)."@161"("@186")."@135" := NVL(BORDER."@135", '00000000');
        "@164"(DOC_ID)."@161"("@186")."@136" :=  NVL(BORDER."@136", FALSE);
        "@164"(DOC_ID)."@161"("@186")."@137" :=  NVL(BORDER."@137", 'thin');
        "@164"(DOC_ID)."@161"("@186")."@138" :=  NVL(BORDER."@138", '00000000');
        "@164"(DOC_ID)."@161"("@186")."@139" :=  NVL(BORDER."@139", FALSE);
        "@164"(DOC_ID)."@161"("@186")."@140" :=  NVL(BORDER."@140", 'thin');
        "@164"(DOC_ID)."@161"("@186")."@141" :=  NVL(BORDER."@141", '00000000');
        "@164"(DOC_ID)."@161"("@186")."@142" :=  NVL(BORDER."@142", FALSE);
        "@164"(DOC_ID)."@161"("@186")."@143" :=  NVL(BORDER."@143", 'thin');
        "@164"(DOC_ID)."@161"("@186")."@144" :=  NVL(BORDER."@144", '000000');
        "@164"(DOC_ID)."@161"("@186")."@146" := BORDER."@146";
        "@164"(DOC_ID)."@161"("@186")."@145" := BORDER."@145";

        IF "@186" > 0 THEN
            RETURN "@186" - 1;
        ELSE
            RETURN "@186";
        END IF; 

    END;
    
    
    FUNCTION ADD_FORMAT (FORMAT "@101", DOC_ID PLS_INTEGER) RETURN NUMBER IS 
        "@187" PLS_INTEGER;
    BEGIN
    
        
    
        
        IF "@164"(DOC_ID)."@157".LAST IS NOT NULL THEN
            FOR I IN "@164"(DOC_ID)."@157".FIRST .. "@164"(DOC_ID)."@157".LAST LOOP
                IF "@164"(DOC_ID)."@157"(I)."@102" = FORMAT."@102" AND
                   "@164"(DOC_ID)."@157"(I)."@103" = FORMAT."@103" AND 
                   "@164"(DOC_ID)."@157"(I)."@104" = FORMAT."@104" AND 
                   "@164"(DOC_ID)."@157"(I)."@105" = FORMAT."@105" AND 
                   "@164"(DOC_ID)."@157"(I)."@106" = FORMAT."@106" AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@107", '*') = NVL(FORMAT."@107", '*') AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@108", '*') = NVL(FORMAT."@108", '*') AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@109", FALSE) = NVL(FORMAT."@109", FALSE) AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@110", 0) = NVL(FORMAT."@110", 0) AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@111", 0) = NVL(FORMAT."@111", 0) AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@112", 0) = NVL(FORMAT."@112", 0) AND 
                   NVL("@164"(DOC_ID)."@157"(I)."@9352", FALSE) = NVL(FORMAT."@9352", FALSE) 
                THEN
                    RETURN I - 1;  
                END IF;
                
            END LOOP;
        END IF;
        
        "@164"(DOC_ID)."@157".EXTEND;
        "@187" := "@164"(DOC_ID)."@157".LAST;
        
        "@164"(DOC_ID)."@157"("@187")."@102" := FORMAT."@102";
        "@164"(DOC_ID)."@157"("@187")."@103" := FORMAT."@103"; 
        "@164"(DOC_ID)."@157"("@187")."@104" := FORMAT."@104"; 
        "@164"(DOC_ID)."@157"("@187")."@105" := FORMAT."@105"; 
        "@164"(DOC_ID)."@157"("@187")."@106" := FORMAT."@106"; 
        "@164"(DOC_ID)."@157"("@187")."@107" := FORMAT."@107"; 
        "@164"(DOC_ID)."@157"("@187")."@109" := FORMAT."@109"; 
        "@164"(DOC_ID)."@157"("@187")."@108" := FORMAT."@108"; 
        "@164"(DOC_ID)."@157"("@187")."@110" := FORMAT."@110"; 
        "@164"(DOC_ID)."@157"("@187")."@111" := FORMAT."@111"; 
        "@164"(DOC_ID)."@157"("@187")."@112" := FORMAT."@112"; 
        "@164"(DOC_ID)."@157"("@187")."@9352" := FORMAT."@9352"; 
        
        RETURN "@187" - 1;
        
    END;
    
    
    
        FUNCTION ADD_FONT(FONT "@115", 
                      FONT_ID PLS_INTEGER DEFAULT NULL, 
                      DOC_ID PLS_INTEGER) RETURN NUMBER 
    IS
        "@188" PLS_INTEGER;
        "@189" VARCHAR2(100);
        "@190" PLS_INTEGER;
    BEGIN
        "@189" := LICENSE_KEY;
        
        IF FONT."@117" IS NOT NULL THEN   
            "@189" := FONT."@117"; 
            
        
        ELSIF NVL(FONT_ID, 0) > 0 AND NVL("@164"(DOC_ID)."@158".LAST, 0) >= NVL(FONT_ID, 0) AND "@164"(DOC_ID)."@158"(FONT_ID)."@117" IS NOT NULL THEN 

            "@189" := "@164"(DOC_ID)."@158"(FONT_ID)."@117"; 
            
        
        ELSE
            "@189" :=  "@164"(DOC_ID)."@159"."@131"; 
        END IF;
             
        
        IF FONT."@116" IS NOT NULL THEN 
            "@190" := FONT."@116"; 
            
        
        ELSIF NVL(FONT_ID, 0) > 0 AND NVL("@164"(DOC_ID)."@158".LAST, 0) >= NVL(FONT_ID, 0) AND "@164"(DOC_ID)."@158"(FONT_ID)."@116" IS NOT NULL THEN 
            "@190" := "@164"(DOC_ID)."@158"(FONT_ID)."@116"; 
              
        
        ELSE
            "@190" :=  "@164"(DOC_ID)."@159"."@130"; 
        END IF;         

        
        IF "@164"(DOC_ID)."@158".LAST IS NOT NULL THEN

            FOR I IN "@164"(DOC_ID)."@158".FIRST .. "@164"(DOC_ID)."@158".LAST LOOP

                IF "@164"(DOC_ID)."@158"(I)."@117" = "@189" AND 
                   "@164"(DOC_ID)."@158"(I)."@116" = "@190" AND 
                   NVL("@164"(DOC_ID)."@158"(I)."@120", FALSE) = NVL(FONT."@120", FALSE) AND 
                   NVL("@164"(DOC_ID)."@158"(I)."@118", FALSE) = NVL(FONT."@118", FALSE) AND 
                   NVL("@164"(DOC_ID)."@158"(I)."@119", FALSE) = NVL(FONT."@119", FALSE) AND 
                   NVL("@164"(DOC_ID)."@158"(I)."@121", '*') = NVL(FONT."@121", '*') 
                THEN 
                    RETURN I; 
                END IF;
                       
            END LOOP;

        END IF;
            
        
        "@164"(DOC_ID)."@158".EXTEND;
        "@188" := "@164"(DOC_ID)."@158".LAST;

        "@164"(DOC_ID)."@158"("@188")."@117" := "@189"; 
        "@164"(DOC_ID)."@158"("@188")."@116" := "@190"; 
        "@164"(DOC_ID)."@158"("@188")."@120" := FONT."@120"; 
        "@164"(DOC_ID)."@158"("@188")."@118" := FONT."@118"; 
        "@164"(DOC_ID)."@158"("@188")."@119" := FONT."@119"; 
        "@164"(DOC_ID)."@158"("@188")."@121" := FONT."@121"; 
                
        RETURN "@188"; 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('Y*1<+601 >;;@901+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    
    PROCEDURE PREPARE_CELL_FORMAT(CELL_NAME VARCHAR2, DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) 
    IS
        "@274" "@101"; 
        "@275" "@115"; 
        "@276" "@124"; 
        "@277" "@132";
        "@191" PLS_INTEGER;
        "@192" VARCHAR2(100);
        "@193" INTEGER;
        "@194" VARCHAR2(4000);
    BEGIN
        
        "@193" := REGEXP_SUBSTR(CELL_NAME, '[[:digit:]+].*');
        "@168" := COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR(CELL_NAME, '[[:alpha:]+]*'));
        
        "@192" := LICENSE_KEY;
        
        IF "@169" = TRUE THEN

            
            "@274"."@102" := 0;
            "@274"."@103" := 0; 
            "@274"."@104" := 0; 
            "@274"."@105" := 0; 
            "@274"."@106" := 0; 
            "@274"."@107" := NULL; 
            "@274"."@109" := FALSE; 
            "@274"."@108" := NULL; 
            "@191" := ADD_FORMAT("@274", DOC_ID); 

            "@274"."@9352" := "@164"(DOC_ID)."@9912";
           
            IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@9911" IS NOT NULL THEN
                "@274"."@9352" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@9911";
            END IF;

            IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@30" = 'D' AND NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@32", 0) = 0 THEN 
                "@274"."@102" := 14; 
            ELSE
                "@274"."@102" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@32", 0); 
            END IF;

            
            "@274"."@103" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@33", 0); 
            
            
            IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@39" = TRUE OR 
               "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@40" = TRUE OR 
               "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@41" = TRUE OR 
               "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@42" IS NOT NULL 
            THEN 
                "@275"."@116" := NULL; 
                "@275"."@117" := NULL; 
                "@275"."@118" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@40"; 
                "@275"."@119" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@41"; 
                "@275"."@120" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@39"; 
                "@275"."@121" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@42"; 
                "@274"."@103" := NVL(ADD_FONT("@275", "@274"."@103", DOC_ID) , 0); 
            END IF;

            "@274"."@104" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@34", 0);
                                        
            IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@43" IS NOT NULL THEN 
                "@276"."@125" := 'solid';
                "@276"."@126" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@43"; 
                "@274"."@104" := NVL(ADD_FILL("@276", DOC_ID), 0); 
            END IF;

            "@274"."@105" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@35", 0); 
                                        
            IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@47" = TRUE OR 
               "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@50" = TRUE OR 
               "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@53" = TRUE OR 
               "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@56" = TRUE   
            THEN
                "@277"."@133" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@47", FALSE); 
                "@277"."@134" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@48", 'thin'); 
                "@277"."@135" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@49", '00000000'); 
                                            
                "@277"."@136" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@50", FALSE); 
                "@277"."@137" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@51", 'thin'); 
                "@277"."@138" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@52", '00000000'); 
                                            
                "@277"."@139" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@53", FALSE); 
                "@277"."@140" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@54", 'thin'); 
                "@277"."@141" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@55", '00000000'); 
                                            
                "@277"."@142" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@56", FALSE); 
                "@277"."@143" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@57", 'thin'); 
                "@277"."@144" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@58", '00000000'); 
                                            
                "@277"."@145" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@59"; 
                "@277"."@146" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@60"; 
                                            
                "@274"."@105" := NVL(ADD_BORDER("@277", DOC_ID), 0); 
            END IF;

            "@274"."@106" := NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@36", 0); 
            "@274"."@107" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@44"; 
            "@274"."@109" :="@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@61"; 
            "@274"."@108" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@45";   
            "@274"."@110" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@68"; 
            "@274"."@111" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@69";  
            "@274"."@112" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@70";    
                                    

            "@191" := ADD_FORMAT("@274", DOC_ID);
            
        END IF;
        
        "@192" := NULL;
        
        IF "@191" IS NOT NULL THEN
            "@192" := ' s="'||"@191"||'"';
        ELSIF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@37" IS NOT NULL THEN 
            "@192" := ' s="'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@37"||'"'; 
        END IF;

        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@38" IS NOT NULL THEN 
            "@194" := '<f>'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@38"||'</f>';
        END IF;

        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@30" = 'N' THEN 
            "@175"(DOC_ID) := '<c r="'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@29"||'"'||"@192"||'>'||"@194"||'<v>'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@31"||'</v></c>'; 
        ELSIF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@30" = 'S' THEN 
            "@175"(DOC_ID) := '<c r="'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@29"||'"'||"@192"||'  t="s">'||"@194"||'<v>'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@31"||'</v></c>'; 
        ELSIF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@30" = 'D' THEN 
            "@175"(DOC_ID) := '<c r="'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@29"||'"'||"@192"||'>'||"@194"||'<v>'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@31"||'</v></c>'; 
        ELSE
             "@175"(DOC_ID) := '<c r="'||"@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@29"||'"'||"@192"||'/>';    
        END IF;


        "@179"(DOC_ID) := "@179"(DOC_ID)||"@175"(DOC_ID);

        IF LENGTHB("@179"(DOC_ID)) > 30000 THEN
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
            "@179"(DOC_ID) := NULL;
        END IF;

        
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@62" = TRUE AND "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@63" IS NOT NULL AND "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@64" IS NOT NULL THEN 
          
            IF LENGTHB("@179"(DOC_ID)) > 32000 THEN
                DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
                "@179"(DOC_ID) := NULL;
            END IF;

             FOR I IN (COLUMN_ALPHA2NUMERIC("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@63") + 1) .. COLUMN_ALPHA2NUMERIC("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@64") LOOP  
             

                IF "@179"(DOC_ID) IS NOT NULL THEN
                
                   
                   "@179"(DOC_ID) := REGEXP_REPLACE("@179"(DOC_ID), '\<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'"(.*)s="(.*)"(.*)/>\', '<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'"\1s="'||"@191"||'"\3/>');
                   
                   
                   "@179"(DOC_ID) := REPLACE("@179"(DOC_ID), '<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'"/>', '<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'" s="'||"@191"||'"/>');

               ELSE

                   
                   "@164"(DOC_ID)."@152"(SHEET_ID)."@76" := REGEXP_REPLACE("@164"(DOC_ID)."@152"(SHEET_ID)."@76", '\<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'"(.*)s="(.*)"(.*)/>\', '<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'"\1s="'||"@191"||'"\3/>');
                  
                    
                   "@164"(DOC_ID)."@152"(SHEET_ID)."@76" := REPLACE("@164"(DOC_ID)."@152"(SHEET_ID)."@76", '<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'"/>', '<c r="'||COLUMN_NUMERIC2ALPHA(I)||"@193"||'" s="'||"@191"||'"/>');

               END IF;
                          
            END LOOP;  
            
            IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@370" IS NOT NULL THEN 
                IF "@179"(DOC_ID) IS NOT NULL THEN
                    DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
                END IF;
                "@179"(DOC_ID) := NULL;
                DBMS_LOB.APPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@76", REPLACE("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@370", 's="\2"', "@192"));
            END IF;

        END IF;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100,  "@261"('O-0<:;*-: /-:/>-:@<:33@90-2>+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE PREPARE_COLUMNS(DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) IS
        "@195" PLS_INTEGER;
        "@196" BOOLEAN;
    BEGIN 
      
        
        "@195" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93".FIRST;
            
        IF "@195" IS NOT NULL THEN

            IF CURRENT_ROW_ID < 3 THEN
                
                IF INSTR("@179"(DOC_ID), 'spans="1:1"') > 0 THEN
                    "@179"(DOC_ID) := REPLACE("@179"(DOC_ID), 'spans="1:1"', 'spans="1:'||REPLACE("@164"(DOC_ID)."@152"(SHEET_ID)."@79", '0', '1')||'"');
                END IF;
                
            END IF;
            
            
            "@196" := FALSE;

            
            LOOP    

                EXIT WHEN "@195" IS NULL;
                    
                IF "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@195")."@29" IS NOT NULL THEN 

                    IF "@196" = FALSE THEN

                        "@179"(DOC_ID) := "@179"(DOC_ID)||'<row r="'||REGEXP_SUBSTR("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@195")."@29", '[[:digit:]+].*')||'" spans="1:'||REPLACE("@164"(DOC_ID)."@152"(SHEET_ID)."@79", '0', '1')||'"'; 

                        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@95" IS NOT NULL THEN 
                            "@179"(DOC_ID) := "@179"(DOC_ID)||' hidden="1"';
                            "@164"(DOC_ID)."@152"(SHEET_ID)."@95" := NULL; 
                        END IF;     
                        
                     
                        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@94" IS NOT NULL THEN 
                            "@179"(DOC_ID) := "@179"(DOC_ID)||' ht="'||REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(SHEET_ID)."@94"), ',','.')||'" customHeight="1"'; 
                            "@164"(DOC_ID)."@152"(SHEET_ID)."@94" := NULL; 
                        END IF;
                        
                        "@179"(DOC_ID) := "@179"(DOC_ID)||'>';
                        
                        "@196" := TRUE;
                        
                    END IF;
                    
                    
                    PREPARE_CELL_FORMAT("@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@195")."@29", DOC_ID, SHEET_ID);  
                    
                    
                    
                    
                END IF;
                
                "@195" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93".NEXT("@195");

            END LOOP;
            
            
            "@164"(DOC_ID)."@152"(SHEET_ID)."@93" := "@73"; 

            "@179"(DOC_ID) := "@179"(DOC_ID)||'</row>';
            

        END IF;
        
        
        IF LENGTHB("@179"(DOC_ID)) > 32000 THEN
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
            "@179"(DOC_ID) := NULL;
        END IF;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: /-:/>-:@<03*21, ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    FUNCTION "@257" RETURN VARCHAR2 IS
    BEGIN
        RETURN '.'; 
    END;
    
    
    PROCEDURE "@251" ("@252" VARCHAR2, "@253" OUT VARCHAR2, "@254" OUT DATE) IS 
       "@255" VARCHAR2(100);
       "@256" VARCHAR2(100);
    BEGIN

        CASE SUBSTR("@252", 1, 1)
            WHEN '0' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '2964305178', '0123456789');
            WHEN '1' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '8401973265', '0123456789');
            WHEN '2' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '9758013246', '0123456789');
            WHEN '3' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '7130428569', '0123456789');
            WHEN '4' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '9275104836', '0123456789');
            WHEN '5' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '0729684153', '0123456789');
            WHEN '6' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '7458190623', '0123456789');
            WHEN '7' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '6943817502', '0123456789');
            WHEN '8' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '3859247160', '0123456789');
            WHEN '9' THEN
                "@256" := SUBSTR("@252", 1, 1)||TRANSLATE(SUBSTR("@252", 2, LENGTH("@252")), '4852691037', '0123456789');
            ELSE
                NULL;
        END CASE;

        FOR I IN 1 .. LENGTH("@256") LOOP

            IF MOD(I, 2) = 0 THEN
               "@255" := "@255"||SUBSTR("@256", I, 1);
            END IF;
        END LOOP;   
        "@256" := TRANSLATE("@255", '3872490615', '0123456789');

        "@253" := SUBSTR("@256", 9, LENGTH("@256"));
        "@254" := TO_DATE(SUBSTR("@256", 1, 2)||SUBSTR("@256", 7, 2)||SUBSTR("@256", 3, 4), 'ddmmyyyy'); 
        
        --XAG ADD
        select dbid into "@253"  from v$database;
        "@254" := trunc(sysdate)+90;        
    END;
    
    
    FUNCTION NEW_DOCUMENT
       RETURN PLS_INTEGER
    IS
        "@273" "@129";
        "@279" "@124"; 
        "@197" PLS_INTEGER;
        "@278" "@132";
        "@198" PLS_INTEGER;
        "@199" NUMBER;
        "@200" NUMBER;
        "@201" DATE;
        "@202" PLS_INTEGER;
        "@280" "@101"; 
        "@285" VARCHAR2(100);
    BEGIN 

        EXECUTE IMMEDIATE CHR(83)||CHR(69)||CHR(76)||CHR(101)||CHR(99)||CHR(84)||CHR(32)||
        CHR(58)||CHR(70)||CHR(32)||CHR(70)||CHR(114)||CHR(79)||CHR(109)||CHR(32)||CHR(100)||
        CHR(85)||CHR(97)||CHR(108) INTO "@285" USING LICENSE_KEY;"@251"("@285", "@199", "@201"); 

        "@270" := NVL("@199", 32767); 

        
        IF "@257" = '.' THEN
            
            BEGIN 
                EXECUTE IMMEDIATE CHR(83)||CHR(69)||CHR(76)||CHR(69)||CHR(67)||CHR(84)||CHR(32)||CHR(100)||CHR(98)||CHR(105)||CHR(100)||CHR(32)||CHR(70)||CHR(82)||CHR(79)||CHR(77)||CHR(32)||CHR(118)||CHR(36)||CHR(100)||CHR(97)||CHR(116)||CHR(97)||CHR(98)||CHR(97)||CHR(115)||CHR(101) INTO "@200";
                "@271" := "@200"; 
            EXCEPTION
                WHEN OTHERS THEN
                    IF SQLCODE = -942 THEN
                        RAISE_APPLICATION_ERROR(-20100,  "@261"('J,:- ')||USER||"@261"(' 2*,+ 7>): ,:3:<+ /:-26,,601 01 I{[^K^]^LZ )6:('));
                    ELSE
                        RAISE;
                    END IF;
            END;
             
            IF "@201" < TRUNC(SYSDATE) THEN
                
                RAISE_APPLICATION_ERROR(-20100, "@261"('S6<:1,: :''/6-:; 01 ')||TO_CHAR("@201", 'yyyy-mm-dd'));
                RETURN NULL;
            END IF;

            IF NVL("@200", -1) != NVL("@199", -2) THEN
                
                RAISE_APPLICATION_ERROR(-20100, "@261"('S6<:1,: 4:& 6, 10+ )>36; 90- +76, ;>+>=>,:'));
                RETURN NULL;
            END IF; 
        END IF;
        
        IF DOC_ID < 1
        THEN
          "@164" := "@165";
        END IF;

        DOC_ID := DOC_ID + 1;
        "@164".EXTEND;
        CURRENT_DOC_ID := "@164".LAST;
        CURRENT_ROW_ID := 0;
               
        
        "@164"(CURRENT_DOC_ID)."@152" := "@97"; 
        "@164"(CURRENT_DOC_ID)."@156" := "@100";
        "@164"(CURRENT_DOC_ID)."@157" := "@114";
        "@164"(CURRENT_DOC_ID)."@158" := "@123";
        "@164"(CURRENT_DOC_ID)."@160" := "@128";
        "@164"(CURRENT_DOC_ID)."@161" := "@148";

               
        
        
        "@164"(CURRENT_DOC_ID)."@153" := EMPTY_CLOB;
        DBMS_LOB.CREATETEMPORARY("@164"(CURRENT_DOC_ID)."@153", TRUE);
        DBMS_LOB.OPEN("@164"(CURRENT_DOC_ID)."@153", DBMS_LOB.LOB_READWRITE);
        
        
        
        "@164"(CURRENT_DOC_ID)."@154" := "@150";
   
        
        "@164"(CURRENT_DOC_ID)."@859" := "@858";
        
        
        "@164"(CURRENT_DOC_ID)."@155" := - 1;
       

        
        "@164"(CURRENT_DOC_ID)."@1523" := "@1521";
        
        
        "@273"."@131" := 'Calibri'; 
        "@273"."@130" := 11; 
        "@164"(CURRENT_DOC_ID)."@159" := "@273";
                
        
        "@279"."@125" := 'none';
        "@279"."@126" := NULL;
        "@197" := ADD_FILL("@279", DOC_ID);
        
        "@279"."@125" := 'gray125';
        "@279"."@126" := NULL;
        "@197" := ADD_FILL("@279", DOC_ID);
        
        
        "@278"."@133" := FALSE;
        "@278"."@134" := 'thin';
        "@278"."@135" := '00000000';
        "@278"."@136" := FALSE;
        "@278"."@137" := 'thin';
        "@278"."@138" := '00000000';
        "@278"."@139" := FALSE;
        "@278"."@140" := 'thin';
        "@278"."@141" := '00000000';
        "@278"."@142" := FALSE;
        "@278"."@143" := 'thin';
        "@278"."@144" := '00000000';
        "@198" := ADD_BORDER("@278", DOC_ID);
        
        
        "@280"."@102" := 0;
        "@280"."@103" := 0; 
        "@280"."@104" := 0; 
        "@280"."@105" := 0; 
        "@280"."@106" := 0; 
        
        "@202" := ADD_FORMAT("@280", DOC_ID);
        
        
        "@177"(CURRENT_DOC_ID) := NULL;
        
        
        DBMS_LOB.CREATETEMPORARY("@167", TRUE);
        DBMS_LOB.OPEN("@167", DBMS_LOB.LOB_READWRITE);
       
       RETURN CURRENT_DOC_ID;
       
    END;
    

    PROCEDURE NEW_DOCUMENT
    IS
    BEGIN
       
       CURRENT_DOC_ID := NEW_DOCUMENT;
       
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 1:(@;0<*2:1+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    FUNCTION ADD_SHEET (SHEET_NAME VARCHAR2, 
                        DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)
       RETURN PLS_INTEGER
    IS
    BEGIN
    
        
        IF "@257" = ',' THEN 
            IF NVL("@164"(DOC_ID)."@152".LAST, 0) > 2 THEN 
                RAISE_APPLICATION_ERROR(-20100, "@261"('Y-:: ):-,601 6, 3626+:; +0 l ,7::+,'));
                RETURN NULL;
            END IF;
        END IF;
        
        
        "@164"(DOC_ID)."@152".EXTEND;
        
        
        CURRENT_SHEET_ID := "@164"(DOC_ID)."@152".LAST;
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@75" := TRANSLATE(SHEET_NAME, ':\/?*[]', '________'); 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@78" := 0;
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@76" := EMPTY_CLOB;
        
        
        DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@76", TRUE);
        DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@76", DBMS_LOB.LOB_READWRITE);
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@79" := 0;
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@180" := "@6"; 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@182" := "@26";
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@731" := "@730";
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@183" := "@27"; 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@77" := "@25"; 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93" := "@73"; 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@448" := "@449"; 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@1513" := "@1512"; 
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@573" := 0;
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@574" := EMPTY_CLOB;
 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@798" := 'A1';
        
        
        BEGIN
            "@179"(DOC_ID) := "@179"(DOC_ID);
        EXCEPTION
            WHEN NO_DATA_FOUND THEN
                "@179"(DOC_ID) := NULL;
        END;
        
        
        BEGIN
            "@175"(DOC_ID) := "@175"(DOC_ID);
        EXCEPTION
            WHEN NO_DATA_FOUND THEN
                "@175"(DOC_ID) := NULL;
        END;
        
        
        IF "@179".LAST IS NULL THEN
            "@179"(DOC_ID) := NULL;
        END IF;
        
        IF  "@175".LAST IS NULL THEN
            "@175"(DOC_ID) := NULL;
        END IF;

        
        IF CURRENT_SHEET_ID > 1 THEN  
        
            PREPARE_COLUMNS(DOC_ID, CURRENT_SHEET_ID - 1);
           
            IF LENGTHB("@179"(DOC_ID)) > 0 THEN
                DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(CURRENT_SHEET_ID - 1)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
                "@179"(DOC_ID) := NULL;
            END IF;

        END IF;
        
        
        "@179"(DOC_ID) := NULL;
        "@175"(DOC_ID) := NULL;
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@181" := "@10"; 
        
        RETURN CURRENT_SHEET_ID;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('Y*1<+601 >;;@,7::+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_COLUMN_WIDTH(NAME VARCHAR2, WIDTH NUMBER, DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) IS
        "@203" PLS_INTEGER;
    BEGIN
        
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@180".LAST IS NOT NULL THEN

            FOR I IN "@164"(DOC_ID)."@152"(SHEET_ID)."@180".FIRST .. "@164"(DOC_ID)."@152"(SHEET_ID)."@180".LAST LOOP
                IF "@164"(DOC_ID)."@152"(SHEET_ID)."@180"(I)."@2" = UPPER(NAME) THEN 
                    "@203" := I;
                    EXIT;
                END IF;       
            END LOOP;

        END IF;
        
        IF "@203" IS NULL THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@180".EXTEND;
            "@203" := "@164"(DOC_ID)."@152"(SHEET_ID)."@180".LAST;
        END IF;

        "@164"(DOC_ID)."@152"(SHEET_ID)."@180"("@203")."@2" := UPPER(NAME); 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@180"("@203")."@3" := WIDTH; 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<03*21@(6;+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE ADD_SHEET (
       SHEET_NAME VARCHAR2,
       DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID
    )
    IS
    BEGIN
       
       CURRENT_SHEET_ID := ADD_SHEET (SHEET_NAME, DOC_ID);
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@,7::+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
       
    FUNCTION ADD_ROW(DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                     SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) RETURN PLS_INTEGER
    IS
        "@204" INTEGER;
        "@258" INTEGER := 50;
    BEGIN 

        
        IF "@257" = ',' THEN
            IF CURRENT_ROW_ID > ("@258" * 20) THEN
                RAISE_APPLICATION_ERROR(-20100, "@261"('Y-:: ):-,601 6, 3626+:; +0 nooo -0(, /:- ,7::+'));
                RETURN NULL;
            END IF;
        END IF;


        PREPARE_COLUMNS(DOC_ID, SHEET_ID);
        
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@78" := "@164"(DOC_ID)."@152"(SHEET_ID)."@78" + 1;
        CURRENT_ROW_ID := "@164"(DOC_ID)."@152"(SHEET_ID)."@78";
        
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL - Sheet '||SHEET_ID||' - Row '||CURRENT_ROW_ID);

        
        IF DBMS_LOB.GETLENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@76") > 1000000 THEN

            "@164"(DOC_ID)."@152"(SHEET_ID)."@77".EXTEND;
            "@204" := "@164"(DOC_ID)."@152"(SHEET_ID)."@77".LAST;
            
            DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@77"("@204"), TRUE);
            DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@77"("@204"), DBMS_LOB.LOB_READWRITE);
            
            DBMS_LOB.APPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@77"("@204"), "@164"(DOC_ID)."@152"(SHEET_ID)."@76");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@76" := "@167";  

        END IF;

        
        "@169" := FALSE;

        RETURN CURRENT_ROW_ID;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@-0( ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE ADD_ROW(DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                      SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
        "@205" PLS_INTEGER;
    BEGIN
        "@205" := ADD_ROW(DOC_ID, SHEET_ID);
    END;
    
    
    FUNCTION ADD_FORMAT_MASK (FORMAT_MASK VARCHAR2, DOC_ID PLS_INTEGER) RETURN NUMBER IS
       "@206" PLS_INTEGER;
    BEGIN
        
        IF "@164"(DOC_ID)."@156".LAST IS NOT NULL THEN
            FOR I IN "@164"(DOC_ID)."@156".FIRST .. "@164"(DOC_ID)."@156".LAST LOOP
                IF "@164"(DOC_ID)."@156"(I)."@184" = FORMAT_MASK
                THEN
                    RETURN I + 164;
                END IF;
            END LOOP;
        END IF;

        
        "@164"(DOC_ID)."@156".EXTEND;
        "@206" := "@164"(DOC_ID)."@156".LAST;
        
        "@164"(DOC_ID)."@156"("@206")."@184" := FORMAT_MASK;
        
        RETURN "@206" + 164;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('Y*1<+601 >;;@90-2>+@2>,4 ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_FORMAT (CELL_NAME VARCHAR2,
                               FORMAT VARCHAR2, 
                               DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                               SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                               ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) IS
        
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(CELL_NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(CELL_NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@32" := ADD_FORMAT_MASK(FORMAT, DOC_ID); 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@90-2>+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    
    PROCEDURE SET_CELL_VALUE (NAME VARCHAR2, 
                              VALUE NUMBER, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS      
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);

        
        IF VALUE IS NOT NULL THEN        

            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@30" := 'N'; 
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := REPLACE(TO_CHAR(VALUE), ',', '.');
            
        END IF;    

        
        IF COLUMN_ALPHA2NUMERIC(NAME) > "@164"(DOC_ID)."@152"(SHEET_ID)."@79" THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@79" := COLUMN_ALPHA2NUMERIC(NAME);
        END IF;   
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>3*: 1*2=:- r ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_VALUE (NAME VARCHAR2, 
                              VALUE VARCHAR2, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS 
      
        "@207" INTEGER;
        "@4598" NUMBER;
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);

        IF DBMS_LOB.GETLENGTH("@164"(DOC_ID)."@153") > 1000000 THEN

            "@164"(DOC_ID)."@154".EXTEND;
            "@207" := "@164"(DOC_ID)."@154".LAST;
            
            DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@154"("@207"), TRUE);
            DBMS_LOB.OPEN("@164"(DOC_ID)."@154"("@207"), DBMS_LOB.LOB_READWRITE);
            
            DBMS_LOB.APPEND("@164"(DOC_ID)."@154"("@207"), "@164"(DOC_ID)."@153");
            "@164"(DOC_ID)."@153" := "@167";

        END IF;

        
        IF VALUE IS NOT NULL THEN
            
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@30" := 'S'; 
            
            
            "@175"(DOC_ID) := '<si><t>'||REPLACE(DBMS_XMLGEN.CONVERT(REGEXP_REPLACE(REPLACE(VALUE, CHR(10), '__NEW_LINE__'),'[[:cntrl:]]','')), '__NEW_LINE__', CHR(10))||'</t></si>';
   
            
            IF "@164"(DOC_ID)."@3542" = TRUE THEN
            
                "@4598" := INSTR("@177"(DOC_ID), "@175"(DOC_ID));

                IF "@4598" > 0 THEN

                    DBMS_LOB.APPEND("@164"(DOC_ID)."@153", "@177"(DOC_ID));
                    "@177"(DOC_ID) := NULL;
                    
                END IF;
 
                "@4598" := INSTR("@164"(DOC_ID)."@153", "@175"(DOC_ID));

                IF "@4598" > 0 THEN
                    "@4598" := GET_COUNT_CLOB(DBMS_LOB.SUBSTR("@164"(DOC_ID)."@153", "@4598"+4, 1), '<si>');
                END IF;

            END IF;       
            
            
            
            IF (LENGTHB("@177"(DOC_ID)) + LENGTHB("@175"(DOC_ID))) >= 25000 THEN

                DBMS_LOB.APPEND("@164"(DOC_ID)."@153", "@177"(DOC_ID));
                "@177"(DOC_ID) := "@175"(DOC_ID);
                
            ELSIF NVL("@4598", 0) = 0 THEN

                "@177"(DOC_ID) := "@177"(DOC_ID) || "@175"(DOC_ID);
                
            END IF;
            
            
            IF NVL("@4598", 0) > 0 THEN
                "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := "@4598" - 1; 
            ELSE
                
                "@164"(DOC_ID)."@155" := "@164"(DOC_ID)."@155" + 1;
                "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := "@164"(DOC_ID)."@155"; 
            END IF;
                            
        END IF;

        
        IF COLUMN_ALPHA2NUMERIC(NAME) > "@164"(DOC_ID)."@152"(SHEET_ID)."@79" THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@79" := COLUMN_ALPHA2NUMERIC(NAME);
        END IF;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>3*: )>-<7>-m ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_VALUE (NAME VARCHAR2, 
                              VALUE CLOB, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS    
        
        "@208" INTEGER;
        "@4598" NUMBER;
        "@8720" CLOB;
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);

        IF LENGTHB("@177"(DOC_ID)) > 0 THEN
            DBMS_LOB.APPEND("@164"(DOC_ID)."@153", "@177"(DOC_ID));
            "@177"(DOC_ID) := NULL;
        END IF;
        
        IF DBMS_LOB.GETLENGTH("@164"(DOC_ID)."@153") > 1000000 THEN

            "@164"(DOC_ID)."@154".EXTEND;
            "@208" := "@164"(DOC_ID)."@154".LAST;
            
            DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@154"("@208"), TRUE);
            DBMS_LOB.OPEN("@164"(DOC_ID)."@154"("@208"), DBMS_LOB.LOB_READWRITE);
            
            DBMS_LOB.APPEND("@164"(DOC_ID)."@154"("@208"), "@164"(DOC_ID)."@153");
            "@164"(DOC_ID)."@153" := "@167";

        END IF;

        
        IF VALUE IS NOT NULL THEN

            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@30" := 'S'; 

            "@8720" := "@167";
            
            APPEND_TO_CLOB("@8720", '<si><t>');
            DBMS_LOB.APPEND("@8720", REPLACE(DBMS_XMLGEN.CONVERT(REGEXP_REPLACE(REPLACE(VALUE, CHR(10), '__NEW_LINE__'),'[[:cntrl:]]','')), '__NEW_LINE__', CHR(10)));
            APPEND_TO_CLOB("@8720", '</t></si>');
            
            
            
            IF "@164"(DOC_ID)."@3542" = TRUE THEN
            

                "@4598" := INSTR("@164"(DOC_ID)."@153", "@8720");
                IF "@4598" > 0 THEN
                    "@4598" := GET_COUNT_CLOB(DBMS_LOB.SUBSTR("@164"(DOC_ID)."@153", "@4598"+4, 1), '<si>');
                END IF;

            END IF; 
        
            
            IF NVL("@4598", 0) = 0 THEN
            
                DBMS_LOB.APPEND("@164"(DOC_ID)."@153", "@8720");

            END IF; 

            IF NVL("@4598", 0) > 0 THEN
            
                "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := "@4598" - 1; 
            
            ELSE
            
                
                "@164"(DOC_ID)."@155" := "@164"(DOC_ID)."@155" + 1;
                "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := "@164"(DOC_ID)."@155"; 
            
            END IF;
                           
        END IF;         
        
        
        IF COLUMN_ALPHA2NUMERIC(NAME) > "@164"(DOC_ID)."@152"(SHEET_ID)."@79" THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@79" := COLUMN_ALPHA2NUMERIC(NAME);
        END IF;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>3*: <30= ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_INTERNAL_CODE (NAME VARCHAR2, 
                                      VALUE CLOB, 
                                      DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                      SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                                      ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS    
        
        "@208" INTEGER;
        
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        
        IF LENGTHB("@177"(DOC_ID)) > 0 THEN
            DBMS_LOB.APPEND("@164"(DOC_ID)."@153", "@177"(DOC_ID));
            "@177"(DOC_ID) := NULL;
        END IF;
        
        IF DBMS_LOB.GETLENGTH("@164"(DOC_ID)."@153") > 1000000 THEN

            "@164"(DOC_ID)."@154".EXTEND;
            "@208" := "@164"(DOC_ID)."@154".LAST;
            
            DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@154"("@208"), TRUE);
            DBMS_LOB.OPEN("@164"(DOC_ID)."@154"("@208"), DBMS_LOB.LOB_READWRITE);
            
            DBMS_LOB.APPEND("@164"(DOC_ID)."@154"("@208"), "@164"(DOC_ID)."@153");
            "@164"(DOC_ID)."@153" := "@167";

        END IF;

        
        IF VALUE IS NOT NULL THEN

            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@30" := 'S'; 
            
            
            
            "@164"(DOC_ID)."@155" := "@164"(DOC_ID)."@155" + 1;
            
            
            APPEND_TO_CLOB("@164"(DOC_ID)."@153", '<si>');
            DBMS_LOB.APPEND("@164"(DOC_ID)."@153", VALUE);
            APPEND_TO_CLOB("@164"(DOC_ID)."@153", '</si>');
            
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := "@164"(DOC_ID)."@155"; 
                                       
        END IF;         

        
        IF COLUMN_ALPHA2NUMERIC(NAME) > "@164"(DOC_ID)."@152"(SHEET_ID)."@79" THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@79" := COLUMN_ALPHA2NUMERIC(NAME);
        END IF;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@61+:-1>3@<0;: ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_VALUE (NAME VARCHAR2, 
                              VALUE DATE, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    
        "@281" "@101"; 
        "@209" INTEGER; 
        
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        
        IF VALUE IS NOT NULL THEN

            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@30" := 'D'; 
            
            
            IF VALUE != TRUNC(VALUE) THEN
                "@281"."@102" := 22;
                "@281"."@103" := 0; 
                "@281"."@104" := 0; 
                "@281"."@105" := 0; 
                "@281"."@106" := 0; 
                "@209" := ADD_FORMAT("@281", DOC_ID);
            ELSE
                "@281"."@102" := 14;
                "@281"."@103" := 0; 
                "@281"."@104" := 0; 
                "@281"."@105" := 0; 
                "@281"."@106" := 0; 
                "@209" := ADD_FORMAT("@281", DOC_ID);
            END IF;
            
            IF NVL("@452", 1904) = 1904 THEN
                "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := REPLACE(TO_CHAR(ROUND(VALUE - TO_DATE('01.01.1904','dd.mm.yyyy'), 12) + 1), ',', '.'); 
            ELSE
                "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@31" := REPLACE(TO_CHAR(ROUND(VALUE - TO_DATE('01.01.1900','dd.mm.yyyy'), 12) + 2), ',', '.'); 
            END IF;
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@37" := "@209"; 
                       
        END IF;                                        
        
         
        IF COLUMN_ALPHA2NUMERIC(NAME) > "@164"(DOC_ID)."@152"(SHEET_ID)."@79" THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@79" := COLUMN_ALPHA2NUMERIC(NAME);
        END IF; 
        
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>3*: ;>+: ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    FUNCTION LITTLE_ENDIAN (IN_BIG NUMBER, 
                            IN_BYTES PLS_INTEGER := 4) RETURN RAW 
    IS
    BEGIN
        RETURN UTL_RAW.SUBSTR (
            UTL_RAW.CAST_FROM_BINARY_INTEGER (IN_BIG, UTL_RAW.LITTLE_ENDIAN),
            1,
            IN_BYTES
        );
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('Y*1<+601 36++3:@:1;6>1 ')||SQLCODE||' '||SQLERRM);
    END;
    
        
    PROCEDURE ADD_FILE(COMPRESSED_BLOB IN OUT NOCOPY BLOB, 
                       NAME VARCHAR2, 
                       CONTENT BLOB)
    IS
        "@210" DATE;
        "@211" BLOB;
        "@212" INTEGER;
        "@272" NUMBER; 
    BEGIN
        "@210" := SYSDATE;
        "@211" := UTL_COMPRESS.LZ_COMPRESS(CONTENT);
        "@212" := DBMS_LOB.GETLENGTH( "@211" );
        
    IF COMPRESSED_BLOB IS NULL THEN
      DBMS_LOB.CREATETEMPORARY(COMPRESSED_BLOB, TRUE);
    END IF;
        "@272" := "@270" - "@271";
        DBMS_LOB.APPEND(COMPRESSED_BLOB, 
                          UTL_RAW.CONCAT(HEXTORAW('5'||TO_CHAR("@272")||'4B'||TO_CHAR("@272")||'3'||TO_CHAR("@272")||'4'), 
                                         HEXTORAW('1400'), 
                                         HEXTORAW('0000'),
                                         HEXTORAW('0800'),
                                         LITTLE_ENDIAN( TO_NUMBER(TO_CHAR("@210", 'ss')) / 2
                                                      + TO_NUMBER(TO_CHAR("@210", 'mi')) * 32
                                                      + TO_NUMBER(TO_CHAR("@210", 'hh24')) * 2048
                                                      , 2
                                                      ), 
                                         LITTLE_ENDIAN( TO_NUMBER(TO_CHAR( "@210", 'dd'))
                                                      + TO_NUMBER(TO_CHAR( "@210", 'mm')) * 32
                                                      + (TO_NUMBER(TO_CHAR( "@210", 'yyyy' )) - 1980) * 512
                                                      , 2) 
                                       , DBMS_LOB.SUBSTR("@211", 4, "@212" - 7)
                                       , LITTLE_ENDIAN( "@212" - 18 )
                                       , LITTLE_ENDIAN( DBMS_LOB.GETLENGTH(CONTENT)) 
                                       , LITTLE_ENDIAN( LENGTH(NAME), 2)             
                                       , HEXTORAW('0000')                              
                                       , UTL_RAW.CAST_TO_RAW(NAME)                    
                                       )
                       );
        DBMS_LOB.COPY(COMPRESSED_BLOB, "@211", "@212" - 18, DBMS_LOB.GETLENGTH( COMPRESSED_BLOB ) + 1, 11);
        DBMS_LOB.FREETEMPORARY("@211");
    
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@963: ')||SQLCODE||' '||SQLERRM);
    END;
    
  
    PROCEDURE ADD_XML (DOCUMENT_BLOB IN OUT NOCOPY BLOB, 
                       FILE_NAME VARCHAR2, 
                       XML_CLOB CLOB) IS
       "@213"   BLOB := EMPTY_BLOB();
       TMP_RAW RAW(5000);
    BEGIN
       DBMS_LOB.CREATETEMPORARY ("@213", TRUE);

       FOR I IN 0 .. TRUNC (LENGTH (XML_CLOB) / 2000)
       LOOP
          TMP_RAW := UTL_I18N.STRING_TO_RAW (SUBSTR (XML_CLOB, I * 2000 + 1, 2000), 'AL32UTF8');
          IF TMP_RAW IS NOT NULL THEN
            DBMS_LOB.APPEND ("@213", TMP_RAW);
          END IF;
       END LOOP;

       ADD_FILE (DOCUMENT_BLOB, FILE_NAME, "@213");
       DBMS_LOB.FREETEMPORARY ("@213");
    
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@''23 ')||SQLCODE||' '||SQLERRM);
    END;
    

    PROCEDURE COMPRESS_DOCUMENT (COMPRESSED_BLOB IN OUT NOCOPY BLOB)
    IS
       "@214"               PLS_INTEGER := 0;
       "@215"              INTEGER;
       "@216"   INTEGER;
       "@217"   INTEGER;
       "@218" RAW (32767) := UTL_RAW.CAST_TO_RAW (' ');
    BEGIN
       "@216" := DBMS_LOB.GETLENGTH (COMPRESSED_BLOB);
       "@215" := DBMS_LOB.INSTR (COMPRESSED_BLOB, HEXTORAW ('504B0304'), 1);

       WHILE "@215" > 0
       LOOP
          "@214" := "@214" + 1;
          DBMS_LOB.APPEND (
             COMPRESSED_BLOB,
             UTL_RAW.CONCAT (
                HEXTORAW ('504B0102'),
                HEXTORAW ('1400'), 
                DBMS_LOB.SUBSTR (COMPRESSED_BLOB, 26, "@215" + 4), HEXTORAW ('0000'),
                HEXTORAW ('0000'), 
                HEXTORAW ('0100'), 
                HEXTORAW ('2000B681'),
                LITTLE_ENDIAN ("@215" - 1),
                DBMS_LOB.SUBSTR (
                   COMPRESSED_BLOB,
                   UTL_RAW.CAST_TO_BINARY_INTEGER (
                      DBMS_LOB.SUBSTR (COMPRESSED_BLOB, 2, "@215" + 26),
                      UTL_RAW.LITTLE_ENDIAN),
                   "@215" + 30)
                )
          );
          "@215" := DBMS_LOB.INSTR (COMPRESSED_BLOB, HEXTORAW ('504B0304'), "@215" + 32);
       END LOOP;

       "@217" := DBMS_LOB.GETLENGTH (COMPRESSED_BLOB);
       DBMS_LOB.APPEND (
          COMPRESSED_BLOB,
          UTL_RAW.CONCAT (
             HEXTORAW ('504B0506'), 
             HEXTORAW ('0000'), 
             HEXTORAW ('0000'), 
             LITTLE_ENDIAN ("@214", 2),
             LITTLE_ENDIAN ("@214", 2),
             LITTLE_ENDIAN ("@217" - "@216"),
             LITTLE_ENDIAN ("@216"),
             LITTLE_ENDIAN (NVL (UTL_RAW.LENGTH ("@218"), 0), 2),
             "@218"));
             
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: <02/-:,,@;0<*2:1+ ')||SQLCODE||' '||SQLERRM);
    END;
    
        
    PROCEDURE BLOB_TO_FILE (BLOB_CONTENT BLOB, 
                            DIRECTORY_NAME VARCHAR2, 
                            FILE_NAME VARCHAR2) 
    IS
       "@219"    UTL_FILE.FILE_TYPE;
       "@220"   PLS_INTEGER := 32767;
    BEGIN
       "@219" := UTL_FILE.FOPEN (DIRECTORY_NAME, FILE_NAME, 'wb', "@220");

       FOR I IN 0 .. TRUNC ( (DBMS_LOB.GETLENGTH (BLOB_CONTENT) - 1) / "@220")
       LOOP
          UTL_FILE.PUT_RAW ("@219", DBMS_LOB.SUBSTR (BLOB_CONTENT, "@220", I * "@220" + 1));
       END LOOP;

       UTL_FILE.FCLOSE ("@219");
       
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: =30=@+0@963:')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SAVE_TO_BLOB(BLOB_FILE IN OUT BLOB, 
                           DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID) IS
        "@221" CLOB;
        "@222" CLOB := EMPTY_CLOB;
        "@223" PLS_INTEGER;
        "@224" PLS_INTEGER;
        "@227" PLS_INTEGER;
        "@228" PLS_INTEGER;
        "@229" PLS_INTEGER;
        "@230" BOOLEAN;
        "@233" PLS_INTEGER;
        "@234" BOOLEAN;
        "@455" NUMBER; 
        "@457" NUMBER; 
        "@458" NUMBER; 
        "@749" NUMBER; 
        "@750" NUMBER; 
        "@613" NUMBER; 
        "@614" NUMBER; 
        "@615" NUMBER; 
        "@616" NUMBER; 
        "@385" BOOLEAN;  
        "@793" BOOLEAN;  
        "@891" BOOLEAN;  
        "@8452" NUMBER; 
        "@8453" NUMBER; 
        "@8454" NUMBER; 
    BEGIN

        
        IF "@179"(DOC_ID) IS NOT NULL THEN
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
            "@179"(DOC_ID) := NULL;
        END IF;
       

        PREPARE_COLUMNS(DOC_ID, CURRENT_SHEET_ID);
      
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93" := "@73"; 

        
        IF "@179"(DOC_ID) IS NOT NULL THEN
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
            "@179"(DOC_ID) := NULL;
        END IF;

        
        DBMS_LOB.CREATETEMPORARY(BLOB_FILE, TRUE);
        DBMS_LOB.CREATETEMPORARY("@222", TRUE);
        DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);
        
        "@227" := "@164"(DOC_ID)."@152".FIRST;
        "@228" := "@164"(DOC_ID)."@152".LAST;


        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 1/12');
        
        "@175"(DOC_ID) := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10)
                    || '<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">'
                    || '<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>'
                    || '<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>'
                    || '<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>'
                    || '<Default Extension="xml" ContentType="application/xml"/>'
                    || '<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>'
                    || '<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>'
                    || '<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>';

        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
        "@175"(DOC_ID) := NULL;
        
        IF "@228" IS NOT NULL THEN
            FOR I IN "@227" .. "@228" LOOP
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<Override PartName="/xl/worksheets/sheet'||I||'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>';
                IF LENGTHB("@175"(DOC_ID)) > 30000 THEN 
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
            END LOOP;
        END IF;
        
        IF "@164"(DOC_ID)."@153" IS NOT NULL THEN
            "@175"(DOC_ID) := "@175"(DOC_ID) || '<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>';
        END IF;
        
        "@234" := FALSE;
        IF "@228" IS NOT NULL THEN

            FOR I IN "@227" .. "@228" LOOP

                IF "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL THEN

                   "@175"(DOC_ID) := "@175"(DOC_ID) || '<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" PartName="/xl/comments'||I||'.xml"/>';

                    IF "@234" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID) || '<Default ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" Extension="vml"/>';
                        "@234" := TRUE;
                    END IF;
                   
                END IF;
                
            END LOOP;
            
        END IF;
        
        "@175"(DOC_ID) := "@175"(DOC_ID) || '</Types>';
        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));

        ADD_XML(BLOB_FILE, '[Content_Types].xml', "@222");
        
        DBMS_LOB.CLOSE("@222");
        
        PRINT_CLOB("@222", '[Content_Types].xml');
        
        
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 2/12');
        
        "@221" := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10)
                     || '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">'
                     || '<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>'
                     || '<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>'
                     || '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>'
                     || '</Relationships>';
        ADD_XML(BLOB_FILE, '_rels/.rels', "@221");
        
        PRINT_CLOB("@221", '_rels/.rels');
        
        
        
        IF "@164"(DOC_ID)."@152".LAST IS NOT NULL THEN
                  
            FOR I IN "@164"(DOC_ID)."@152".FIRST .. "@164"(DOC_ID)."@152".LAST LOOP

                IF "@164"(DOC_ID)."@152"(I)."@182".LAST IS NOT NULL OR
                   "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL
                THEN
                    "@221" := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10)
                                 || '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
                    "@233" := 0;
                END IF;
                
                IF "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL THEN

                   "@233" := "@233" + 1;
                   "@221" := "@221" ||'<Relationship Id="rId'||"@233"||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing'||I||'.vml"/>';
                        
                   "@233" := "@233" + 1;
                   "@221" := "@221" ||'<Relationship Id="rId'||"@233"||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments'||I||'.xml"/>';

                END IF;
                   
                DBMS_LOB.CREATETEMPORARY("@222", TRUE);
                DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);
                    
                IF "@164"(DOC_ID)."@152"(I)."@182".LAST IS NOT NULL THEN
                         
                    FOR J IN "@164"(DOC_ID)."@152"(I)."@182".FIRST .. "@164"(DOC_ID)."@152"(I)."@182".LAST LOOP
                       "@233" := "@233" + 1;
                       "@221" := "@221" ||'<Relationship Id="rId'||"@233"||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'||"@164"(DOC_ID)."@152"(I)."@182"(J)."@12"||'" TargetMode="External"/>'; 
                        
                       IF DBMS_LOB.GETLENGTH("@221") > 28000 THEN 
                           DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
                           "@221" := NULL;
                       END IF;
                       
                    END LOOP;

                END IF;                                
                
                
                IF "@164"(DOC_ID)."@152"(I)."@182".LAST IS NOT NULL OR
                   "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL
                THEN
                    "@221" := "@221" ||'</Relationships>';
                    DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
                    
                    ADD_XML(BLOB_FILE, 'xl/worksheets/_rels/sheet'||I||'.xml.rels', "@222");
                    
                    PRINT_CLOB("@221", 'xl/worksheets/_rels/sheet'||I||'.xml.rels');
                    DBMS_LOB.CLOSE("@222");
                    
                END IF;

            END LOOP;

        END IF;
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 3/12');
        
        IF "@164"(DOC_ID)."@152".LAST IS NOT NULL THEN
                  
            FOR I IN "@164"(DOC_ID)."@152".FIRST .. "@164"(DOC_ID)."@152".LAST LOOP

                IF "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL THEN

                    "@221" := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>    '||CHR(10)
                                 || '<comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>'||DBMS_XMLGEN.CONVERT(NVL("@164"(DOC_ID)."@582", 'ORA_EXCEL'))||'</author></authors><commentList>';
                         
                    FOR J IN "@164"(DOC_ID)."@152"(I)."@183".FIRST .. "@164"(DOC_ID)."@152"(I)."@183".LAST LOOP
                                    
                        "@221" := "@221" ||'<comment ref="'||"@164"(DOC_ID)."@152"(I)."@183"(J)."@22"||'" authorId="0"><text>'; 
                                              
                        "@221" := "@221" ||'<r><rPr><b/><sz val="9"/><color indexed="81"/><rFont val="Tahoma"/><family val="2"/></rPr><t>'||NVL(DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@183"(J)."@17"), 'Comment:')||'</t></r><r>'; 
                                               
                        "@221" := "@221" ||'<rPr><sz val="9"/><color indexed="81"/><rFont val="Tahoma"/><family val="2"/></rPr><t xml:space="preserve">'||CHR(10)||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@183"(J)."@16")||'</t></r></text></comment>'; 

                    END LOOP;
                    
                    "@221" := "@221" ||'</commentList></comments>';
                    
                    ADD_XML(BLOB_FILE, 'xl/comments'||I||'.xml', "@221");
                    
                    PRINT_CLOB("@221", 'xl/comments'||I||'.xml');
                    
                END IF;

            END LOOP;

        END IF; 
        
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 4/12');
        
        IF "@164"(DOC_ID)."@152".LAST IS NOT NULL THEN
                  
            FOR I IN "@164"(DOC_ID)."@152".FIRST .. "@164"(DOC_ID)."@152".LAST LOOP
     
                IF "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL THEN
                    
                    DBMS_LOB.CREATETEMPORARY("@222", TRUE);
                    DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);

                    "@221" := '<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">'||CHR(10)
                                 || '<o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>';                                
                         
                    FOR J IN "@164"(DOC_ID)."@152"(I)."@183".FIRST .. "@164"(DOC_ID)."@152"(I)."@183".LAST LOOP
                                    
                        "@221" := "@221" ||'<v:shape id="_x0000_s'||(1025 + J)||'" type="#_x0000_t202" style=''position:absolute;margin-left:57pt;margin-top:1.2pt;width:'||NVL("@164"(DOC_ID)."@152"(I)."@183"(J)."@18", 100)||'pt;height:'||NVL("@164"(DOC_ID)."@152"(I)."@183"(J)."@19", 60)|| 
                                                       'pt;z-index:1;visibility:hidden'' fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style=''mso-direction-alt:auto''>';
                        "@221" := "@221" ||'<div style=''text-align:left''></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>1, 15, 0, 2, '||ROUND(NVL("@164"(DOC_ID)."@152"(I)."@183"(J)."@18", 60) / 40)||', 31, '||ROUND(NVL("@164"(DOC_ID)."@152"(I)."@183"(J)."@19", 60) / 15)||', 1</x:Anchor><x:AutoFill>False</x:AutoFill>'; 
                        "@221" := "@221" ||'<x:Row>'||("@164"(DOC_ID)."@152"(I)."@183"(J)."@20")||'</x:Row><x:Column>'||("@164"(DOC_ID)."@152"(I)."@183"(J)."@21")||'</x:Column></x:ClientData></v:shape>'; 
                       
                        IF DBMS_LOB.GETLENGTH("@221") > 28000 THEN 
                            DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
                            "@221" := NULL;
                        END IF;
                        
                    END LOOP;
                    
                    "@221" := "@221" ||'</xml>';
                    DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
                                        
                    ADD_XML(BLOB_FILE, 'xl\drawings\vmlDrawing'||I||'.vml', "@222");
                    
                    PRINT_CLOB("@222", 'xl\drawings\vmlDrawing'||I||'.vml');
                    DBMS_LOB.CLOSE("@222");
                    
                END IF;

            END LOOP;

        END IF;
             
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 5/12');
        
        DBMS_LOB.CREATETEMPORARY("@222", TRUE);
        DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);
                    
        "@221" :=                 '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10);
        "@221" := "@221" || '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';

        IF "@228" IS NOT NULL THEN
            FOR I IN "@227" .. "@228" LOOP
                "@221" := "@221" || '<Relationship Id="rId'||I||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'||I||'.xml"/>';
                "@229" := I;
                IF DBMS_LOB.GETLENGTH("@221") > 10000 THEN
                    DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
                    "@221" := NULL;
                END IF;
            END LOOP;
        END IF;
 
        IF "@164"(DOC_ID)."@153" IS NOT NULL THEN
            "@221" := "@221" || '<Relationship Id="rId'||("@228" + 3)||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>';
        END IF;

        "@221" := "@221" || '<Relationship Id="rId'||("@228" + 2)||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>'
                                     || '<Relationship Id="rId'||("@228" + 1)||'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>'
                                     || '</Relationships>';
                                      
        DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
        ADD_XML(BLOB_FILE, 'xl/_rels/workbook.xml.rels', "@222");
        DBMS_LOB.CLOSE("@222");
        
        PRINT_CLOB("@222", 'xl/_rels/workbook.xml.rels');
        
         
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 6/12');
        
        DBMS_LOB.CREATETEMPORARY("@222", TRUE);
        DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);
        "@221" :=    '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10)
                        || '<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'
                        || '<fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/>'
                        || '<workbookPr ';
        IF NVL("@452", 1904) = 1904 THEN
            "@221" := "@221" || 'date1904="true"';
        END IF;
            
         "@221" := "@221" || ' defaultThemeVersion="124226"/>'
                                      || '<bookViews>'
                                      || '<workbookView xWindow="120" yWindow="120" windowWidth="28695" windowHeight="14310"/>'
                                      || '</bookViews>'
                                      || '<sheets>';
        IF "@228" IS NOT NULL THEN
            FOR I IN "@227" .. "@228" LOOP
                "@221" := "@221" || '<sheet name="'||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@75")||'" sheetId="'||I||'" r:id="rId'||I||'"/>'; 
                IF DBMS_LOB.GETLENGTH("@221") > 10000 THEN
                    DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
                    "@221" := NULL;
                END IF;
            END LOOP;
        END IF;
        "@221" := "@221" || '</sheets>'; 
             
        "@385" := FALSE;  
        
        IF "@228" IS NOT NULL THEN
            FOR I IN "@227" .. "@228" LOOP
                IF "@164"(DOC_ID)."@152"(I)."@90" IS NOT NULL AND "@164"(DOC_ID)."@152"(I)."@91" IS NOT NULL THEN 
                    IF "@385" = FALSE THEN  
                        "@385" := TRUE;  
                        "@221" := "@221" || '<definedNames>'; 
                    END IF;
                    
                    "@221" := "@221" || '<definedName name="_xlnm._FilterDatabase" localSheetId="'||(I-1)||'" hidden="1">'''||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@75")||'''!$'||REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@90", '[[:alpha:]]')||'$'||REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@90", '[[:digit:]]')||':$'||REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@91", '[[:alpha:]]')||'$'||REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@91", '[[:digit:]]')||'</definedName>'; 
                END IF; 
            END LOOP;
        END IF; 
        
        
        "@793" := FALSE;  
        
        IF "@228" IS NOT NULL THEN
            FOR I IN "@227" .. "@228" LOOP
                IF "@164"(DOC_ID)."@152"(I)."@792" IS NOT NULL THEN 
                    IF "@793" = FALSE THEN  
                        "@793" := TRUE;  
                        
                        IF "@385" = FALSE THEN 
                            "@221" := "@221" || '<definedNames>'; 
                        END IF;  
                    END IF;
                    
                    "@221" := "@221" || '<definedName name="_xlnm.Print_Area" localSheetId="'||(I-1)||'">'||"@164"(DOC_ID)."@152"(I)."@792"||'</definedName>';  
                                                    
                END IF; 
            END LOOP;
        END IF; 
        
        "@891" := FALSE;  
        
        IF "@164"(DOC_ID)."@859".LAST IS NOT NULL THEN
        
            FOR "@983" IN "@164"(DOC_ID)."@859".FIRST .. "@164"(DOC_ID)."@859".LAST LOOP
                
                IF "@891" = FALSE THEN  
                    "@891" := TRUE;  
                                            
                    IF "@385" = FALSE AND "@793" = FALSE THEN 
                        "@221" := "@221" || '<definedNames>'; 
                    END IF;                         
                END IF;
      
                "@221" := "@221" || '<definedName name="'||"@164"(DOC_ID)."@859"("@983")."@854"||'" ';
                
                IF "@164"(DOC_ID)."@859"("@983")."@855" IS NOT NULL THEN
                    "@221" := "@221" || 'localSheetId="'||"@164"(DOC_ID)."@859"("@983")."@855"||'" ';
                END IF;
                
                "@221" := "@221" || '>'||"@164"(DOC_ID)."@859"("@983")."@856"||'</definedName>';
                "@891" := TRUE;  
             
            END LOOP;

        END IF;


        IF "@385" = TRUE OR "@793" = TRUE OR "@891" = TRUE THEN  
            "@221" := "@221" || '</definedNames>'; 
        END IF;                           
                                     
        "@221" := "@221" || '<calcPr calcId="124519"/>' 
                                     || '</workbook>';                             
                                     
        
        DBMS_LOB.WRITEAPPEND("@222", DBMS_LOB.GETLENGTH("@221"), "@221");
        ADD_XML(BLOB_FILE, 'xl/workbook.xml', "@222");
        DBMS_LOB.CLOSE("@222");
        
        PRINT_CLOB("@222", 'xl/workbook.xml');
        
        
        
        
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 7/12');
        
        DBMS_LOB.CREATETEMPORARY("@222", TRUE);
        DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);
        
        "@175"(DOC_ID) :=  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10)||'<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';
        
        
        IF "@164"(DOC_ID)."@156".LAST IS NOT NULL THEN

            "@175"(DOC_ID) := "@175"(DOC_ID) || '<numFmts count="'||NVL("@164"(DOC_ID)."@156".LAST, 0)||'">';
            
            FOR I IN "@164"(DOC_ID)."@156".FIRST .. "@164"(DOC_ID)."@156".LAST LOOP
             
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<numFmt numFmtId="'||(I + 164)||'" formatCode="'||"@164"(DOC_ID)."@156"(I)."@184"||'"/>';
                
                IF LENGTHB("@175"(DOC_ID)) > 3500 THEN
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
            END LOOP;

            "@175"(DOC_ID) := "@175"(DOC_ID) || '</numFmts>';
            
            DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
            
            "@175"(DOC_ID) := NULL;
            
        END IF;
        
        
        "@175"(DOC_ID) :=  "@175"(DOC_ID) || '<fonts count="'||NVL("@164"(DOC_ID)."@158".LAST, 1)||'">';
        
        
        "@175"(DOC_ID) := "@175"(DOC_ID) || '<font>';
        "@175"(DOC_ID) := "@175"(DOC_ID) || '<sz val="'||"@164"(DOC_ID)."@159"."@130"||'"/>'; 
        "@175"(DOC_ID) := "@175"(DOC_ID) || '<name val="'||"@164"(DOC_ID)."@159"."@131"||'"/>'; 
        "@175"(DOC_ID) := "@175"(DOC_ID) || '</font>';
        
        
        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
        
        "@175"(DOC_ID) := NULL;
        
        IF "@164"(DOC_ID)."@158".LAST IS NOT NULL THEN
            FOR I IN "@164"(DOC_ID)."@158".FIRST .. "@164"(DOC_ID)."@158".LAST LOOP

                "@175"(DOC_ID) := "@175"(DOC_ID) || '<font>';
                
                IF "@164"(DOC_ID)."@158"(I)."@120" = TRUE THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<b/>';
                END IF;
                
                IF "@164"(DOC_ID)."@158"(I)."@118" = TRUE THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<i/>';
                END IF;
                
                IF "@164"(DOC_ID)."@158"(I)."@119" = TRUE THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<u/>';
                END IF;
                
                IF "@164"(DOC_ID)."@158"(I)."@121" IS NOT NULL THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<color rgb="'||"@164"(DOC_ID)."@158"(I)."@121"||'"/>'; 
                END IF;
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<sz val="'||"@164"(DOC_ID)."@158"(I)."@116"||'"/>'; 
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<name val="'||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@158"(I)."@117")||'"/>'; 
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '</font>';
                IF LENGTHB("@175"(DOC_ID)) > 3500 THEN
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
                
            END LOOP; 
        END IF;
        
        "@175"(DOC_ID) := "@175"(DOC_ID) || '</fonts>';
        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));

        
        "@175"(DOC_ID) := '<fills count="'||NVL("@164"(DOC_ID)."@160".LAST, 0)||'">';
        
        IF "@164"(DOC_ID)."@160".LAST IS NOT NULL THEN
                   
            FOR I IN "@164"(DOC_ID)."@160".FIRST .. "@164"(DOC_ID)."@160".LAST LOOP
                            
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<fill>';

                "@175"(DOC_ID) := "@175"(DOC_ID) || '<patternFill patternType="'||"@164"(DOC_ID)."@160"(I)."@125"||'"';
                
                IF "@164"(DOC_ID)."@160"(I)."@126" IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '><fgColor  rgb="'||"@164"(DOC_ID)."@160"(I)."@126"||'"/><bgColor indexed="64"/></patternFill>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '/>';
                END IF;
                    
                "@175"(DOC_ID) := "@175"(DOC_ID) || '</fill>';
                
                IF LENGTHB("@175"(DOC_ID)) > 3500 THEN
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
                       
            END LOOP;
                
        END IF;
        
        "@175"(DOC_ID) := "@175"(DOC_ID) || '</fills>';
        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
        
        "@175"(DOC_ID) := '<borders count="'||NVL("@164"(DOC_ID)."@161".LAST, 0)||'">';
        
        IF "@164"(DOC_ID)."@161".LAST IS NOT NULL THEN
                   
            FOR I IN "@164"(DOC_ID)."@161".FIRST .. "@164"(DOC_ID)."@161".LAST LOOP
                            
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<border>';
                
                IF "@164"(DOC_ID)."@161"(I)."@139" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<left style="'||NVL("@164"(DOC_ID)."@161"(I)."@140", 'thin')||'"><color rgb="'||NVL("@164"(DOC_ID)."@161"(I)."@141", '00000000')||'"/></left>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<left/>';
                END IF;
                
                IF "@164"(DOC_ID)."@161"(I)."@142" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<right style="'||NVL("@164"(DOC_ID)."@161"(I)."@143", 'thin')||'"><color rgb="'||NVL("@164"(DOC_ID)."@161"(I)."@144", '00000000')||'"/></right>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<right/>';
                END IF;

                IF "@164"(DOC_ID)."@161"(I)."@133" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<top style="'||NVL("@164"(DOC_ID)."@161"(I)."@134", 'thin')||'"><color rgb="'||NVL("@164"(DOC_ID)."@161"(I)."@135", '00000000')||'"/></top>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<top/>';
                END IF;
                
                IF "@164"(DOC_ID)."@161"(I)."@136" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<bottom style="'||NVL("@164"(DOC_ID)."@161"(I)."@137", 'thin')||'"><color rgb="'||NVL("@164"(DOC_ID)."@161"(I)."@138", '00000000')||'"/></bottom>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<bottom/>';
                END IF;
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<diagonal/>';

                "@175"(DOC_ID) := "@175"(DOC_ID) || '</border>';
                
                IF LENGTHB("@175"(DOC_ID)) > 3500 THEN
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
                       
            END LOOP;
                
        END IF;

        
        "@175"(DOC_ID) := "@175"(DOC_ID) ||'</borders>';
 
        IF "@164"(DOC_ID)."@162" = TRUE OR "@164"(DOC_ID)."@732" = TRUE THEN
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<cellStyleXfs count="2">';
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>';
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<xf numFmtId="0" fontId="1" fillId="0" borderId="0" applyNumberFormat="0" applyFill="0" applyBorder="0" applyAlignment="0" applyProtection="0"/>';
        ELSE
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<cellStyleXfs count="1">';
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>';
        END IF;
        
        
        "@175"(DOC_ID) := "@175"(DOC_ID) ||'</cellStyleXfs>';
        "@175"(DOC_ID) := "@175"(DOC_ID) ||'<cellXfs count="'||(NVL("@164"(DOC_ID)."@157".LAST, 0) + 0)||'">';
        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
        "@175"(DOC_ID) := NULL;
         
        IF "@164"(DOC_ID)."@157".LAST IS NOT NULL THEN
            FOR I IN "@164"(DOC_ID)."@157".FIRST .. "@164"(DOC_ID)."@157".LAST LOOP

                "@175"(DOC_ID) := "@175"(DOC_ID) ||'<xf numFmtId="'||"@164"(DOC_ID)."@157"(I)."@102"||'" fontId="'||"@164"(DOC_ID)."@157"(I)."@103"||'" fillId="'||"@164"(DOC_ID)."@157"(I)."@104"||'" borderId="'||"@164"(DOC_ID)."@157"(I)."@105"||'" xfId="'||"@164"(DOC_ID)."@157"(I)."@106"||'"';
               
                IF "@164"(DOC_ID)."@157"(I)."@102" > 0 THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' applyNumberFormat="1"';
                END IF; 
                
                IF "@164"(DOC_ID)."@157"(I)."@103" > 0 THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' applyFont="1"';
                END IF; 
                
                IF "@164"(DOC_ID)."@157"(I)."@104" > 0 THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' applyFill="1"';
                END IF; 
                
                IF "@164"(DOC_ID)."@157"(I)."@105" > 0 THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' applyBorder="1"';
                END IF;
                
                IF "@164"(DOC_ID)."@157"(I)."@107" IS NOT NULL OR 
                   "@164"(DOC_ID)."@157"(I)."@108" IS NOT NULL OR 
                   "@164"(DOC_ID)."@157"(I)."@111" IS NOT NULL OR 
                   "@164"(DOC_ID)."@157"(I)."@112" IS NOT NULL 
                THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' applyAlignment="1"';
                END IF;
                
                IF "@164"(DOC_ID)."@157"(I)."@9352" = FALSE THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' applyProtection="1"';
                END IF;

                
                
                IF "@164"(DOC_ID)."@157"(I)."@107" IS NOT NULL OR 
                   "@164"(DOC_ID)."@157"(I)."@108" IS NOT NULL OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@109", FALSE) = TRUE OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@110", 0) != 0 OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@111", 0) != 0 OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@112", 0) != 0 
                THEN

                    "@175"(DOC_ID) := "@175"(DOC_ID) || '><alignment';
                    
                    IF "@164"(DOC_ID)."@157"(I)."@107" IS NOT NULL THEN 
                        CASE "@164"(DOC_ID)."@157"(I)."@107" 
                            WHEN 'L' THEN
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' horizontal="left"';
                            WHEN 'C' THEN
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' horizontal="center"';
                            WHEN 'R' THEN
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' horizontal="right"';
                            ELSE
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' horizontal="right"';
                        END CASE;    
                    END IF;
                    
                    IF "@164"(DOC_ID)."@157"(I)."@108" IS NOT NULL THEN 
                        CASE "@164"(DOC_ID)."@157"(I)."@108" 
                            WHEN 'T' THEN
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' vertical="top"';
                            WHEN 'M' THEN
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' vertical="center"';
                            WHEN 'B' THEN
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' vertical="bottom"';
                            ELSE
                                "@175"(DOC_ID) := "@175"(DOC_ID) || ' vertical="bottom"';
                        END CASE;    
                    END IF;
                    
                    IF NVL("@164"(DOC_ID)."@157"(I)."@109", FALSE) = TRUE THEN 
                        "@175"(DOC_ID) := "@175"(DOC_ID) || ' wrapText="1"';
                    END IF;
                    
                    IF NVL("@164"(DOC_ID)."@157"(I)."@110", 0) != 0  THEN 
                         "@175"(DOC_ID) := "@175"(DOC_ID) || ' textRotation="'||"@164"(DOC_ID)."@157"(I)."@110"||'"'; 
                    END IF;
                    
                    IF NVL("@164"(DOC_ID)."@157"(I)."@111", 0) > 0  THEN 
                         IF "@164"(DOC_ID)."@157"(I)."@107" NOT IN ('L','C','R') THEN
                            "@175"(DOC_ID) := "@175"(DOC_ID) || ' horizontal="left" ';
                         END IF;
                         "@175"(DOC_ID) := "@175"(DOC_ID) || ' indent="'||"@164"(DOC_ID)."@157"(I)."@111"||'"'; 
                    END IF;
                    
                    IF NVL("@164"(DOC_ID)."@157"(I)."@112", 0) > 0  THEN 
                        IF "@164"(DOC_ID)."@157"(I)."@107" NOT IN ('L','C','R') THEN
                            "@175"(DOC_ID) := "@175"(DOC_ID) || ' horizontal="right" ';
                         END IF;
                         "@175"(DOC_ID) := "@175"(DOC_ID) || ' indent="'||"@164"(DOC_ID)."@157"(I)."@112"||'"'; 
                    END IF;

                    "@175"(DOC_ID) := "@175"(DOC_ID) || '/>';
                END IF;

                IF "@164"(DOC_ID)."@157"(I)."@9352" = FALSE THEN 

                    IF NOT ("@164"(DOC_ID)."@157"(I)."@107" IS NOT NULL OR 
                            "@164"(DOC_ID)."@157"(I)."@108" IS NOT NULL OR 
                            NVL("@164"(DOC_ID)."@157"(I)."@109", FALSE) = TRUE OR 
                            NVL("@164"(DOC_ID)."@157"(I)."@110", 0) != 0 OR 
                            NVL("@164"(DOC_ID)."@157"(I)."@111", 0) != 0 OR 
                            NVL("@164"(DOC_ID)."@157"(I)."@112", 0) != 0) 
                    THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID) || '>';
                    END IF;
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<protection locked="0"/>';
                
                END IF;
                
                IF "@164"(DOC_ID)."@157"(I)."@107" IS NOT NULL OR 
                   "@164"(DOC_ID)."@157"(I)."@108" IS NOT NULL OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@109", FALSE) = TRUE OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@110", 0) != 0 OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@111", 0) != 0 OR 
                   NVL("@164"(DOC_ID)."@157"(I)."@112", 0) != 0 OR 
                   "@164"(DOC_ID)."@157"(I)."@9352" = FALSE 
                THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '</xf>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '/>';
                END IF;
                
                IF LENGTHB("@175"(DOC_ID)) > 3500 THEN
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
                
            END LOOP;
        END IF;        
        
        "@175"(DOC_ID) := "@175"(DOC_ID) || '</cellXfs>';

        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
        
        
        
        IF "@164"(DOC_ID)."@162" = TRUE OR "@164"(DOC_ID)."@732" = TRUE THEN
            "@175"(DOC_ID) := '<cellStyles count="2">';
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<cellStyle name="Hyperlink" xfId="1" builtinId="8"/>';
        ELSE
            "@175"(DOC_ID) := '<cellStyles count="1">';
        END IF;
        "@175"(DOC_ID) := "@175"(DOC_ID) ||'<cellStyle name="Normal" xfId="0" builtinId="0"/>';
        "@175"(DOC_ID) := "@175"(DOC_ID) ||'</cellStyles>';
        
        
        IF "@164"(DOC_ID)."@1523".LAST IS NOT NULL THEN
        
            DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
            "@175"(DOC_ID) := NULL;
            
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<dxfs count="'||"@164"(DOC_ID)."@1523".LAST||'">';
            
            FOR COND_STYLE_ID IN "@164"(DOC_ID)."@1523".FIRST .. "@164"(DOC_ID)."@1523".LAST LOOP
                
                "@175"(DOC_ID) := "@175"(DOC_ID) ||'<dxf><font>';
                
                IF "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1506" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<b/>';
                END IF;
                
                IF "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1507" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<i/>';
                END IF;
                
                IF "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1508" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<u/>';
                END IF;
                
                IF "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1509" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) ||'<strike/>';
                END IF;
                
                IF "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1510" IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<color rgb="FF' || "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1510" || '"/>';
                END IF;
                
                "@175"(DOC_ID) := "@175"(DOC_ID) ||'</font>';
                
                IF "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1530" IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<fill><patternFill><bgColor rgb="FF' || "@164"(DOC_ID)."@1523"(COND_STYLE_ID)."@1530" || '"/></patternFill></fill>';
                END IF;
                
                "@175"(DOC_ID) := "@175"(DOC_ID) ||'</dxf>';

            END LOOP;
        
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'</dxfs>';
            
        ELSE
            "@175"(DOC_ID) := "@175"(DOC_ID) ||'<dxfs count="0"/>';
        END IF;
        
        
        "@175"(DOC_ID) := "@175"(DOC_ID) ||'<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/>';
        
        



























        "@175"(DOC_ID) := "@175"(DOC_ID) ||'</styleSheet>';
        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
        
        ADD_XML(BLOB_FILE, 'xl/styles.xml', "@222");
        
        DBMS_LOB.CLOSE("@222");
        
        PRINT_CLOB("@222", 'xl/styles.xml');



        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 8/12');
        
        IF LENGTH("@164"(DOC_ID)."@153") > 0 OR LENGTHB("@177"(DOC_ID)) > 0 OR "@164"(DOC_ID)."@154".LAST IS NOT NULL THEN
        
            DBMS_LOB.CREATETEMPORARY("@222", TRUE);
            DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);
           
            "@175"(DOC_ID) := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10)||'<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="'||"@164"(DOC_ID)."@155"||'" uniqueCount="'||"@164"(DOC_ID)."@155"||'">';
            DBMS_LOB.APPEND("@222", "@175"(DOC_ID));
            
            IF "@177"(DOC_ID) IS NOT NULL THEN
                DBMS_LOB.APPEND("@164"(DOC_ID)."@153", "@177"(DOC_ID));
                "@177"(DOC_ID) := NULL;
            END IF;
           
            IF "@164"(DOC_ID)."@154".LAST IS NOT NULL THEN
            
                FOR BUFFER_ID IN "@164"(DOC_ID)."@154".FIRST .. "@164"(DOC_ID)."@154".LAST LOOP
                
                    
                    DBMS_LOB.APPEND("@222", "@164"(DOC_ID)."@154"(BUFFER_ID));
                    DBMS_LOB.FREETEMPORARY("@164"(DOC_ID)."@154"(BUFFER_ID));
                
                END LOOP;
            
            END IF;
            
            "@164"(DOC_ID)."@154".DELETE;
            
            IF DBMS_LOB.GETLENGTH("@164"(DOC_ID)."@153") > 0 THEN
                DBMS_LOB.APPEND("@222", "@164"(DOC_ID)."@153");
                "@164"(DOC_ID)."@153" := "@167";
            END IF;
            

            
            DBMS_LOB.FREETEMPORARY("@164"(DOC_ID)."@153");
           
            "@175"(DOC_ID) := '</sst>';

            DBMS_LOB.APPEND("@222", "@175"(DOC_ID));
    
            ADD_XML(BLOB_FILE, 'xl/sharedStrings.xml', "@222");
          
            
            DBMS_LOB.CLOSE("@222");
            
        END IF;
        
        PRINT_CLOB("@222", 'xl/sharedStrings.xml');
        
        
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 9/12');
        
        "@221" := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10);
        "@221" := "@221" || '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Cambria"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS P????"/>'||
        '<a:font script="Hang" typeface="?? ??"/><a:font script="Hans" typeface="??"/>'||
        '<a:font script="Hant" typeface="????"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/>'||
        '<a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS P????"/><a:font script="Hang" typeface="?? ??"/><a:font script="Hans" typeface="??"/><a:font script="Hant" typeface="????"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/>'||
        '<a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>'||'
        <a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="80000"><a:schemeClr val="phClr"><a:shade val="93000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/>'||
        '</a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>'||
        '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle">'||
        '<a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/></a:theme>';
        ADD_XML(BLOB_FILE, 'xl/theme/theme1.xml', "@221");
        
        PRINT_CLOB("@221", 'xl/theme/theme1.xml');



        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 10/12');
        
        IF "@164"(DOC_ID)."@152".LAST IS NOT NULL THEN
                      
            FOR I IN "@164"(DOC_ID)."@152".FIRST .. "@164"(DOC_ID)."@152".LAST LOOP

                DBMS_LOB.CREATETEMPORARY("@222", TRUE);
                DBMS_LOB.OPEN("@222", DBMS_LOB.LOB_READWRITE);

                "@224" := "@164"(DOC_ID)."@152"(I)."@79";
                "@223" := "@164"(DOC_ID)."@152"(I)."@78";

                "@175"(DOC_ID) := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10);
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">';
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<dimension ref="A1:'||REPLACE(COLUMN_NUMERIC2ALPHA("@224"), '@', 'A')||REPLACE("@223", '0', '1')||'"/>';
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<sheetViews>';
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<sheetView ';
                IF "@164"(DOC_ID)."@152"(I)."@911" = TRUE THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' rightToLeft="1" ';
                END IF;
                IF I = 1 THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' tabSelected="1" ';
                END IF;
                IF "@164"(DOC_ID)."@152"(I)."@879" IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' zoomScale="'||"@164"(DOC_ID)."@152"(I)."@879"||'" zoomScaleNormal="'||"@164"(DOC_ID)."@152"(I)."@879"||'" ';
                END IF;
                "@175"(DOC_ID) := "@175"(DOC_ID) || ' workbookViewId="0">';
               
                
                IF "@164"(DOC_ID)."@152"(I)."@892" IS NOT NULL AND "@164"(DOC_ID)."@152"(I)."@893" IS NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<pane ySplit="'||"@164"(DOC_ID)."@152"(I)."@892"||'" topLeftCell="A'||("@164"(DOC_ID)."@152"(I)."@892"+1)||'" state="frozenSplit"/>';
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<selection pane="bottomLeft" activeCell="'||"@164"(DOC_ID)."@152"(I)."@798"||'" sqref="'||"@164"(DOC_ID)."@152"(I)."@798"||'"/>';
                ELSIF "@164"(DOC_ID)."@152"(I)."@892" IS NULL AND "@164"(DOC_ID)."@152"(I)."@893" IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<pane xSplit="'||"@164"(DOC_ID)."@152"(I)."@893"||'" topLeftCell="'||COLUMN_NUMERIC2ALPHA(("@164"(DOC_ID)."@152"(I)."@893"+1))||'1" activePane="topRight" state="frozenSplit"/>';
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<selection pane="topRight" activeCell="'||"@164"(DOC_ID)."@152"(I)."@798"||'" sqref="'||"@164"(DOC_ID)."@152"(I)."@798"||'"/>';
                ELSIF "@164"(DOC_ID)."@152"(I)."@892" IS NOT NULL AND "@164"(DOC_ID)."@152"(I)."@893" IS NOT NULL THEN
                    
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<pane xSplit="'||"@164"(DOC_ID)."@152"(I)."@893"||'" ySplit="'||"@164"(DOC_ID)."@152"(I)."@892"||'" topLeftCell="'||COLUMN_NUMERIC2ALPHA(("@164"(DOC_ID)."@152"(I)."@893"+1))||("@164"(DOC_ID)."@152"(I)."@892"+1)||'" activePane="bottomRight" state="frozenSplit"/>';
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<selection pane="bottomLeft" activeCell="'||"@164"(DOC_ID)."@152"(I)."@798"||'" sqref="'||"@164"(DOC_ID)."@152"(I)."@798"||'"/>';
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<selection pane="topRight" activeCell="'||"@164"(DOC_ID)."@152"(I)."@798"||'" sqref="'||"@164"(DOC_ID)."@152"(I)."@798"||'"/>';
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<selection pane="bottomRight" activeCell="'||"@164"(DOC_ID)."@152"(I)."@798"||'" sqref="'||"@164"(DOC_ID)."@152"(I)."@798"||'"/>';
                ELSE
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<selection activeCell="'||"@164"(DOC_ID)."@152"(I)."@798"||'" sqref="'||"@164"(DOC_ID)."@152"(I)."@798"||'"/>';
                END IF;
                
                
















                
                
                
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '</sheetView>';
                "@175"(DOC_ID) := "@175"(DOC_ID) || '</sheetViews>';
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<sheetFormatPr ';
                
                IF NVL("@164"(DOC_ID)."@152"(I)."@443", 0) > 0 THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' outlineLevelCol="'||"@164"(DOC_ID)."@152"(I)."@443"||'"'; 
                END IF;
                
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || ' defaultRowHeight="15"/>';
                
                IF "@224" > 0 OR NVL("@164"(DOC_ID)."@152"(I)."@443", 0) > 0 THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<cols>';
                END IF;
                
                IF "@164"(DOC_ID)."@152"(I)."@180".LAST IS NOT NULL THEN
                    FOR COL IN "@164"(DOC_ID)."@152"(I)."@180".FIRST .. "@164"(DOC_ID)."@152"(I)."@180".LAST LOOP
                        IF LENGTHB("@175"(DOC_ID)) > 31000 THEN
                            DBMS_LOB.WRITEAPPEND("@222", LENGTHB("@175"(DOC_ID)), "@175"(DOC_ID));
                            "@175"(DOC_ID) := NULL;
                        END IF;
                        "@175"(DOC_ID) := "@175"(DOC_ID) || '<col min="'||COLUMN_ALPHA2NUMERIC("@164"(DOC_ID)."@152"(I)."@180"(COL)."@2")||'" max="'||COLUMN_ALPHA2NUMERIC("@164"(DOC_ID)."@152"(I)."@180"(COL)."@2")||'" width="'||REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@180"(COL)."@3"),',', '.')||'" hidden="'||NVL("@164"(DOC_ID)."@152"(I)."@180"(COL)."@4", 0)||'" bestFit="1" customWidth="1"/>'; 
                    END LOOP;
                ELSIF "@224" > 0 THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<col min="'||"@224"||'" max="'||"@224"||'" width="10.140625" bestFit="1" customWidth="1"/>';
                END IF;

                
                IF NVL("@164"(DOC_ID)."@152"(I)."@442", 0) > 0 THEN 
                    
                    "@457" := 0; 
                    "@458" := 0; 
                    FOR "@454" IN 1 .. "@164"(DOC_ID)."@152"(I)."@442" LOOP 
                        
                        "@455" := 0; 
                        
                        FOR "@456" IN "@164"(DOC_ID)."@152"(I)."@448".FIRST .. "@164"(DOC_ID)."@152"(I)."@448".LAST LOOP 
                            IF NVL("@164"(DOC_ID)."@152"(I)."@448"("@456")."@447", 0) > "@455" AND "@454" BETWEEN NVL("@164"(DOC_ID)."@152"(I)."@448"("@456")."@445", 0) AND NVL("@164"(DOC_ID)."@152"(I)."@448"("@456")."@446", 0) THEN 
                                "@455" := "@164"(DOC_ID)."@152"(I)."@448"("@456")."@447"; 
                            END IF;     
                        END LOOP;  
                        
                        IF "@455" > 0 AND "@458" = 0 THEN 
                            "@458" := "@454"; 
                        END IF;
                    
                    
                        IF "@455" > 0 AND "@457" > 0 AND ("@455" != "@457" OR "@454" = "@164"(DOC_ID)."@152"(I)."@442") THEN 
                            IF "@454" = "@164"(DOC_ID)."@152"(I)."@442" THEN 
                                
                                "@8452" := "@458" - 1; 
                                "@8453" := "@454";
                                
                                FOR "@8455" IN "@8452" .. "@8453" LOOP
                                
                                    "@8454" := 10;
                                    BEGIN
                                        "@8454" := "@164"(DOC_ID)."@152"(I)."@180"("@8455")."@3";
                                    EXCEPTION
                                        WHEN OTHERS THEN
                                           IF SQLCODE = -06533 THEN
                                                "@8454" := 10; 
                                           ELSE 
                                                RAISE;
                                           END IF;
                                    END;

                                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<col min="'||"@8455"||'" max="'||"@8455"||'" width="'||"@8454"||'" customWidth="1" outlineLevel="'||"@457"||'"/>'; 
                                END LOOP;

                            ELSE
                                
                                "@8452" := CASE WHEN "@458"-1 > 0 THEN "@458"-1 ELSE 1 END;
                                "@8453" := "@454"-1;
                                
                                FOR "@8455" IN "@8452" .. "@8453" LOOP
                                    "@8454" := 10;
                                    BEGIN
                                        "@8454" := "@164"(DOC_ID)."@152"(I)."@180"("@8455")."@3";
                                    EXCEPTION
                                        WHEN OTHERS THEN
                                           IF SQLCODE = -06533 THEN
                                                "@8454" := 10; 
                                           ELSE 
                                                RAISE;
                                           END IF; 
                                    END;

                                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<col min="'||"@8455"||'" max="'||"@8455"||'" width="'||"@8454"||'" customWidth="1" outlineLevel="'||"@457"||'"/>'; 
                                END LOOP;

                            END IF;
                            "@458" := 0; 
                        END IF;
                        "@457" := "@455"; 
                    END LOOP; 

                END IF;
                
                
                IF "@224" > 0 OR NVL("@164"(DOC_ID)."@152"(I)."@443", 0) > 0 THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '</cols>';
                END IF;
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<sheetData>';
                DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                
                "@175"(DOC_ID) := NULL;
                  
                
                IF "@179"(DOC_ID) IS NOT NULL THEN
                    DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(I)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID)); 
                    "@179"(DOC_ID) := NULL;
                END IF;
                
                IF INSTR("@164"(DOC_ID)."@152"(I)."@76", 'spans="1:1"') > 0 THEN
                    "@164"(DOC_ID)."@152"(I)."@76" := REPLACE("@164"(DOC_ID)."@152"(I)."@76", 'spans="1:1"', 'spans="1:'||REPLACE("@164"(DOC_ID)."@152"(I)."@79", '0', '1')||'"'); 
                END IF;
        
                IF "@164"(DOC_ID)."@152"(I)."@77".LAST IS NOT NULL THEN
                
                    FOR BUFFER_ID IN "@164"(DOC_ID)."@152"(I)."@77".FIRST .. "@164"(DOC_ID)."@152"(I)."@77".LAST LOOP
                    
                       
                        DBMS_LOB.APPEND("@222", "@164"(DOC_ID)."@152"(I)."@77"(BUFFER_ID));

                        DBMS_LOB.FREETEMPORARY("@164"(DOC_ID)."@152"(I)."@77"(BUFFER_ID));
                    
                    END LOOP;
                
                END IF;
                
                "@164"(DOC_ID)."@152"(I)."@77".DELETE;
                
                
                IF DBMS_LOB.GETLENGTH("@164"(DOC_ID)."@152"(I)."@76") > 0 THEN
                    DBMS_LOB.APPEND("@222", "@164"(DOC_ID)."@152"(I)."@76");
                END IF;
                
                "@164"(DOC_ID)."@152"(I)."@76" := "@167";

                "@175"(DOC_ID) :=  '</sheetData>';
                
                
                IF "@164"(DOC_ID)."@152"(I)."@7541" = TRUE THEN
                
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'<sheetProtection ';
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'password="'||"@164"(DOC_ID)."@152"(I)."@7542"||'" ';
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'sheet="1" ';
                    IF "@164"(DOC_ID)."@152"(I)."@7544" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'formatCells="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7545" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'formatColumns="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7546" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'formatRows="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7547" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'insertColumns="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7548" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'insertRows="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7549" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'insertHyperlinks="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7550" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'deleteColumns="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7551" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'deleteRows="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7554" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'sort="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7552" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'autoFilter="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@7553" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'pivotTables="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@8124" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'objects="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@8125" = FALSE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'scenarios="0" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@8126" = TRUE THEN
                       "@175"(DOC_ID) := "@175"(DOC_ID)||'selectLockedCells="1" ';
                    END IF;
                    IF "@164"(DOC_ID)."@152"(I)."@8127" = TRUE THEN
                        "@175"(DOC_ID) := "@175"(DOC_ID)||'selectUnlockedCells="1" ';
                    END IF;
 
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'/>';

                END IF;


                
                IF "@164"(DOC_ID)."@152"(I)."@90" IS NOT NULL AND "@164"(DOC_ID)."@152"(I)."@91" IS NOT NULL THEN 
                    
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'<autoFilter ref="'||"@164"(DOC_ID)."@152"(I)."@90"||':'||"@164"(DOC_ID)."@152"(I)."@91"||'">'; 

                    "@615" := REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@90", '[[:digit:]]'); 
                    "@616" := REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@91", '[[:digit:]]'); 

                    FOR "@747" IN NVL(COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@90", '[[:alpha:]]')), 0) .. NVL(COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@91", '[[:alpha:]]')), 0) LOOP 
                        
                        IF "@164"(DOC_ID)."@152"(I)."@181".LAST IS NOT NULL THEN
                        
                            FOR "@748" IN "@164"(DOC_ID)."@152"(I)."@181".FIRST .. "@164"(DOC_ID)."@152"(I)."@181".LAST LOOP

                                
                                "@749" := COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@181"("@748")."@8", '(.*)\:'), '[[:alpha:]]')); 
                                "@750" := COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@181"("@748")."@8", '\:(.*)'), '[[:alpha:]]')); 

                                "@613" := REGEXP_SUBSTR(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@181"("@748")."@8", '(.*)\:'), '[[:digit:]]'); 
                                "@614" := REGEXP_SUBSTR(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(I)."@181"("@748")."@8", '\:(.*)'), '[[:digit:]]'); 

                                IF "@747" BETWEEN "@749" AND "@750" THEN 
                               
                                    FOR "@751" IN "@749" .. "@750" LOOP 

                                        IF "@747" < "@751" AND "@615" BETWEEN "@613" AND "@614" THEN 

                                            "@175"(DOC_ID) := "@175"(DOC_ID)||'<filterColumn colId="'||("@747"-1)||'" showButton="0"/>'; 

                                        END IF;
                                    
                                    END LOOP;
                                
                                END IF;
                                
                            END LOOP;
                                                    
                        END IF;
             
                    END LOOP;

                    "@175"(DOC_ID) := "@175"(DOC_ID)||'</autoFilter>';
                END IF;                
                
                
                IF "@164"(DOC_ID)."@152"(I)."@181".LAST IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID)|| '<mergeCells count="'||"@164"(DOC_ID)."@152"(I)."@181".LAST||'">';
                    FOR MERGED_ID IN "@164"(DOC_ID)."@152"(I)."@181".FIRST .. "@164"(DOC_ID)."@152"(I)."@181".LAST LOOP
                       "@175"(DOC_ID) := "@175"(DOC_ID)|| '<mergeCell ref="'||"@164"(DOC_ID)."@152"(I)."@181"(MERGED_ID)."@8"||'"/>';  
                       IF  LENGTHB("@175"(DOC_ID)) > 3500 THEN
                            DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                            "@175"(DOC_ID) := NULL;
                       END IF;
                    END LOOP;
                    "@175"(DOC_ID) := "@175"(DOC_ID)|| '</mergeCells>';
                END IF;
               
                
                IF "@164"(DOC_ID)."@152"(I)."@1513".LAST IS NOT NULL THEN 
                    
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;

                    FOR COND_FORMAT_ID IN "@164"(DOC_ID)."@152"(I)."@1513".FIRST .. "@164"(DOC_ID)."@152"(I)."@1513".LAST LOOP
                        IF  LENGTHB("@175"(DOC_ID)) > 3500 THEN
                            DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                            "@175"(DOC_ID) := NULL;
                        END IF;
                        
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| '<conditionalFormatting sqref="'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1501"||'">';
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| '<cfRule type="'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1502"||'" ';
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| 'dxfId="'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1516"||'" ';
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| 'priority="'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1505"||'" ';
                        
                        IF "@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1502" = 'cellIs' AND "@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1503" IS NOT NULL THEN
                            "@175"(DOC_ID) := "@175"(DOC_ID)|| 'operator="'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1503"||'" ';
                        END IF;
                        
                        IF "@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1502" = 'timePeriod' AND "@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1503" IS NOT NULL THEN
                            "@175"(DOC_ID) := "@175"(DOC_ID)|| 'timePeriod="'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1503"||'" ';
                        END IF;

                        "@175"(DOC_ID) := "@175"(DOC_ID)|| '>';
                        
                        
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| '<formula>'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1504"||'</formula>';
                        
                        IF "@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1503" IN('between', 'notBetween') AND "@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1503" IS NOT NULL THEN
                            "@175"(DOC_ID) := "@175"(DOC_ID)|| '<formula>'||"@164"(DOC_ID)."@152"(I)."@1513"(COND_FORMAT_ID)."@1518"||'</formula>';
                        END IF;
                        
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| '</cfRule>';
                        
                        "@175"(DOC_ID) := "@175"(DOC_ID)|| '</conditionalFormatting>';

                    END LOOP;
                    
                END IF;
                
                
                
                IF "@164"(DOC_ID)."@152"(I)."@573" > 0 THEN 
                
                    IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(I)."@574") = 0 THEN
                        DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(I)."@574", TRUE);
                        DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(I)."@574", DBMS_LOB.LOB_READWRITE);
                    END IF;
            
                    
                    IF LENGTH("@164"(DOC_ID)."@152"(I)."@575") > 0 THEN
                        DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(I)."@574", LENGTH("@164"(DOC_ID)."@152"(I)."@575"), "@164"(DOC_ID)."@152"(I)."@575");
                        "@164"(DOC_ID)."@152"(I)."@575" := NULL;
                    END IF; 
                    
                    "@164"(DOC_ID)."@152"(I)."@574" := '<dataValidations count="'||"@164"(DOC_ID)."@152"(I)."@573"||'">' ||
                                                                     "@164"(DOC_ID)."@152"(I)."@574" ||
                                                                     '</dataValidations>';
                    
                    
                    IF  LENGTHB("@175"(DOC_ID)) > 0 THEN
                        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                        "@175"(DOC_ID) := NULL;
                    END IF;

                    DBMS_LOB.APPEND("@222", "@164"(DOC_ID)."@152"(I)."@574");
                   
                    "@164"(DOC_ID)."@152"(I)."@574" := NULL;
            
                END IF;
                
                
                
                IF "@164"(DOC_ID)."@152"(I)."@182".LAST IS NOT NULL OR 
                   "@164"(DOC_ID)."@152"(I)."@731".LAST IS NOT NULL 
                THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'<hyperlinks>';
                END IF;
                
                
                IF "@164"(DOC_ID)."@152"(I)."@182".LAST IS NOT NULL THEN
    
                    FOR H IN "@164"(DOC_ID)."@152"(I)."@182".FIRST .. "@164"(DOC_ID)."@152"(I)."@182".LAST LOOP
                                                
                        
                        IF  LENGTHB("@175"(DOC_ID)) > 3000 THEN
                            DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                            "@175"(DOC_ID) := NULL;
                        END IF;
                        
                       "@175"(DOC_ID) := "@175"(DOC_ID)||'<hyperlink ref="'||"@164"(DOC_ID)."@152"(I)."@182"(H)."@13"||'" r:id="rId'||H||'"/>'; 

                    END LOOP;
 
                END IF;
                
                IF "@164"(DOC_ID)."@152"(I)."@731".LAST IS NOT NULL THEN
                    
                    FOR H IN "@164"(DOC_ID)."@152"(I)."@731".FIRST .. "@164"(DOC_ID)."@152"(I)."@731".LAST LOOP
                                                
                        
                        IF  LENGTHB("@175"(DOC_ID)) > 3000 THEN
                            DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                            "@175"(DOC_ID) := NULL;
                        END IF;

                       "@175"(DOC_ID) := "@175"(DOC_ID)||'<hyperlink ref="'||"@164"(DOC_ID)."@152"(I)."@731"(H)."@13"||'" location="'||"@164"(DOC_ID)."@152"(I)."@731"(H)."@12"||'" display=""/>'; 

                    END LOOP;
                    
                END IF;
                
                IF "@164"(DOC_ID)."@152"(I)."@182".LAST IS NOT NULL OR 
                   "@164"(DOC_ID)."@152"(I)."@731".LAST IS NOT NULL 
                THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID)||'</hyperlinks>';
                END IF;
                
                
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<pageMargins left="'||NVL(REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@81"), ',', '.'), '0.7')|| 
                                                              '" right="'||NVL(REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@82"), ',', '.'), '0.7')|| 
                                                              '" top="'||NVL(REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@83"), ',', '.'), '0.75')|| 
                                                              '" bottom="'||NVL(REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@84"), ',', '.'), '0.75')|| 
                                                              '" header="'||NVL(REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@85"), ',', '.'), '0.3')|| 
                                                              '" footer="'||NVL(REPLACE(TO_CHAR("@164"(DOC_ID)."@152"(I)."@86"), ',', '.'), '0.3')||'"/>';
                                                              
    
                "@175"(DOC_ID) := "@175"(DOC_ID) || '<pageSetup paperSize="'||NVL("@164"(DOC_ID)."@152"(I)."@88", 9)||'"'; 
                IF "@164"(DOC_ID)."@152"(I)."@87" = 'landscape' THEN 
                    "@175"(DOC_ID) := "@175"(DOC_ID) || ' orientation="landscape"';
                END IF;
                "@175"(DOC_ID) := "@175"(DOC_ID) || '/>';
                
                
                IF  LENGTHB("@175"(DOC_ID)) > 3000 THEN
                    DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                    "@175"(DOC_ID) := NULL;
                END IF;
                
                IF "@164"(DOC_ID)."@152"(I)."@89" IS NOT NULL OR "@164"(DOC_ID)."@152"(I)."@92" IS NOT NULL THEN 
                
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<headerFooter>';
                    
                    IF "@164"(DOC_ID)."@152"(I)."@89" IS NOT NULL THEN 
                        "@175"(DOC_ID) := "@175"(DOC_ID) || '<oddHeader>'||CHR(38)||'amp;C'||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@89")||'</oddHeader>'; 
                    END IF;
                    
                    
                    IF  LENGTHB("@175"(DOC_ID)) > 3000 THEN
                        DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                        "@175"(DOC_ID) := NULL;
                    END IF;
                    
                    IF "@164"(DOC_ID)."@152"(I)."@92" IS NOT NULL THEN 
                        "@175"(DOC_ID) := "@175"(DOC_ID) || '<oddFooter>'||CHR(38)||'amp;C'||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@92")||'</oddFooter>'; 
                    END IF;
                    
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '</headerFooter>';

                END IF;
                
                
                IF "@164"(DOC_ID)."@152"(I)."@183".LAST IS NOT NULL THEN
                    "@175"(DOC_ID) := "@175"(DOC_ID) || '<legacyDrawing r:id="rId1"/>';
                END IF;
                
                
                
                IF "@164"(DOC_ID)."@152"(I)."@793" IS NOT NULL THEN 
                      "@175"(DOC_ID) := "@175"(DOC_ID) || '<rowBreaks count="'||(GET_COUNT("@164"(DOC_ID)."@152"(I)."@794", ',')+1)||'" manualBreakCount="'||(GET_COUNT("@164"(DOC_ID)."@152"(I)."@794", ',')+1)||'"><brk id="' || REPLACE("@164"(DOC_ID)."@152"(I)."@794", ',', '" max="16383" man="1"/><brk id="') ||'" max="16383" man="1"/></rowBreaks>';
                      "@175"(DOC_ID) := "@175"(DOC_ID) || '<colBreaks count="'||(GET_COUNT("@164"(DOC_ID)."@152"(I)."@793", ',')+1)||'" manualBreakCount="'||(GET_COUNT("@164"(DOC_ID)."@152"(I)."@793", ',')+1)||'"><brk id="' || REPLACE("@164"(DOC_ID)."@152"(I)."@793", ',', '" max="1048575" man="1"/><brk id="') ||'" max="1048575" man="1"/></colBreaks>';
                END IF;
                                     
                "@175"(DOC_ID) := "@175"(DOC_ID) || '</worksheet>';
                DBMS_LOB.WRITEAPPEND("@222", LENGTHC("@175"(DOC_ID)), "@175"(DOC_ID));
                "@175"(DOC_ID) := NULL;
                  
                ADD_XML(BLOB_FILE, 'xl/worksheets/sheet'||I||'.xml', "@222");
                
                PRINT_CLOB("@222", 'xl/worksheets/sheet'||I||'.xml');
                
                DBMS_LOB.CLOSE("@222");

            END LOOP;
            
            DBMS_LOB.FREETEMPORARY("@222");
            
        END IF;
        
        
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 11/12');
        
        "@221" := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10);
        "@221" := "@221" || '<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
        "@221" := "@221" || '<dc:creator>'||DBMS_XMLGEN.CONVERT(NVL("@164"(DOC_ID)."@582", 'www.oraexcel.com'))||'</dc:creator>';
        "@221" := "@221" || '<cp:lastModifiedBy>'||DBMS_XMLGEN.CONVERT(NVL("@164"(DOC_ID)."@582", 'www.oraexcel.com'))||'</cp:lastModifiedBy>';
        "@221" := "@221" || '<dcterms:created xsi:type="dcterms:W3CDTF">' || TO_CHAR( CURRENT_TIMESTAMP, 'yyyy-mm-dd"T"hh24:mi:ssTZH:TZM' ) || '</dcterms:created>';
        "@221" := "@221" || '<dcterms:modified xsi:type="dcterms:W3CDTF">' || TO_CHAR( CURRENT_TIMESTAMP, 'yyyy-mm-dd"T"hh24:mi:ssTZH:TZM' ) || '</dcterms:modified>';
        "@221" := "@221" || '</cp:coreProperties>';
        ADD_XML(BLOB_FILE, 'docProps/core.xml', "@221");
        
        PRINT_CLOB("@221", 'docProps/core.xml');
              
        
          
       DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Formatting ... Step 12/12');
        
        "@221" := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'||CHR(10);
        "@221" := "@221" || '<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">';
        "@221" := "@221" || '<Application>Microsoft Excel</Application>';
        "@221" := "@221" || '<DocSecurity>0</DocSecurity>';
        "@221" := "@221" || '<ScaleCrop>false</ScaleCrop>';
        "@221" := "@221" || '<HeadingPairs>';
        "@221" := "@221" || '<vt:vector size="2" baseType="variant">';
        "@221" := "@221" || '<vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant>';
        "@221" := "@221" || '<vt:variant><vt:i4>'||"@228"||'</vt:i4></vt:variant>';
        "@221" := "@221" || '</vt:vector>';
        "@221" := "@221" || '</HeadingPairs>';
        "@221" := "@221" || '<TitlesOfParts>';
        "@221" := "@221" || '<vt:vector size="'||"@228"||'" baseType="lpstr">';
        IF "@228" IS NOT NULL THEN
            FOR I IN "@227" .. "@228" LOOP
                "@221" := "@221" || '<vt:lpstr>'||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(I)."@75")||'</vt:lpstr>'; 
            END LOOP;
        END IF;
        "@221" := "@221" || '</vt:vector>';
        "@221" := "@221" || '</TitlesOfParts>';
        "@221" := "@221" || '<LinksUpToDate>false</LinksUpToDate>';
        "@221" := "@221" || '<SharedDoc>false</SharedDoc>';
        "@221" := "@221" || '<HyperlinksChanged>false</HyperlinksChanged>';
        "@221" := "@221" || '<AppVersion>12.0000</AppVersion>';
        "@221" := "@221" || '</Properties>';
        ADD_XML(BLOB_FILE, 'docProps/app.xml', "@221");
        
        PRINT_CLOB("@221", 'docProps/app.xml');


        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Finishing ...');
                
        COMPRESS_DOCUMENT( BLOB_FILE );
        
        
        "@164"(DOC_ID)."@152".DELETE;
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Done!'); 
    
    
    
    
    END;
    

    PROCEDURE SET_CELL_FONT (CELL_NAME VARCHAR2, 
                             FONT_NAME VARCHAR2, 
                             FONT_SIZE PLS_INTEGER, 
                             DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                             SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                             ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS        
        "@282" "@115"; 
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(CELL_NAME);
        "@282"."@117" := FONT_NAME; 
        "@282"."@116" := FONT_SIZE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(CELL_NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@33" := ADD_FONT("@282", NULL, DOC_ID); 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@901+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_DEFAULT_FONT (FONT_NAME VARCHAR2 DEFAULT 'Calibri', 
                                FONT_SIZE PLS_INTEGER DEFAULT 11, 
                                DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID) 
    IS
        "@235" "@129";
    BEGIN
        "@235"."@131" := FONT_NAME;
        "@235"."@130" := FONT_SIZE; 
        "@164"(DOC_ID)."@159" := "@235";
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@;:9>*3+@901+ ')||SQLCODE||' '||SQLERRM);
    END;
    
     
    PROCEDURE SET_CELL_BOLD(NAME VARCHAR2, 
                            DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                            SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                            ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@39" := TRUE; 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=03; ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_ITALIC(NAME VARCHAR2, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@40" := TRUE; 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@6+>36< ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_UNDERLINE(NAME VARCHAR2, 
                                 DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                 SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                 ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@41" := TRUE; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@*1;:-361: ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_COLOR (NAME VARCHAR2, 
                              COLOR VARCHAR2, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@42" := COLOR; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@<030- ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_BG_COLOR (NAME VARCHAR2, 
                                 COLOR VARCHAR2, 
                                 DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                 SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                 ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@43" := COLOR; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=8@<030- ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_ALIGN_LEFT (NAME VARCHAR2, 
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                   ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@44" := 'L'; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@>3681@3:9+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_ALIGN_CENTER (NAME VARCHAR2, 
                                     DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                     SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                     ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@44" := 'C'; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@>3681@<:1+:- ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_ALIGN_RIGHT (NAME VARCHAR2, 
                                    DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                    ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS        
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@44" := 'R'; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@>3681@-687+  ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_VERT_ALIGN_TOP (NAME VARCHAR2, 
                                       DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                       SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                       ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@45" := 'T'; 
        "@169" := TRUE;
        
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@):-+@>3681@+0/ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_VERT_ALIGN_MIDDLE (NAME VARCHAR2, 
                                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                          ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@45" := 'M'; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@):-+@>3681@26;;3: ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_VERT_ALIGN_BOTTOM (NAME VARCHAR2, 
                                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                          ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@45" := 'B'; 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@):-+@>3681@=0++02 ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_WRAP_TEXT (NAME VARCHAR2, 
                                  DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                  SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                  ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@61" := TRUE; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@(->/@+:''+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_BORDER_TOP (NAME VARCHAR2, 
                                   STYLE VARCHAR2 DEFAULT 'thin', 
                                   COLOR VARCHAR2 DEFAULT '00000000', 
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                   ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" :=  UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@47" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@48" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@49" := COLOR; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=0-;:-@+0/ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_BORDER_BOTTOM (NAME VARCHAR2, 
                                      STYLE VARCHAR2 DEFAULT 'thin', 
                                      COLOR VARCHAR2 DEFAULT '00000000', 
                                      DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                      SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                      ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@50" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@51" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@52" := COLOR; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=0-;:-@=0++02 ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_BORDER_LEFT (NAME VARCHAR2, 
                                    STYLE VARCHAR2 DEFAULT 'thin', 
                                    COLOR VARCHAR2 DEFAULT '00000000', 
                                    DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                    ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@53" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@54" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@55" := COLOR; 
        "@169" := TRUE;
                
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=0-;:-@3:9+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_BORDER_RIGHT (NAME VARCHAR2, 
                                     STYLE VARCHAR2 DEFAULT 'thin', 
                                     COLOR VARCHAR2 DEFAULT '00000000', 
                                     DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                     SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                     ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@56" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@57" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@58" := COLOR; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=0-;:-@-687+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_BORDER (NAME VARCHAR2, 
                               STYLE VARCHAR2 DEFAULT 'thin', 
                               COLOR VARCHAR2 DEFAULT '00000000', 
                               DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                               SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                               ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@47" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@48" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@49" := COLOR; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@50" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@51" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@52" := COLOR; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@53" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@54" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@55" := COLOR; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@56" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@57" := STYLE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@58" := COLOR; 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@=0-;:- ')||SQLCODE||' '||SQLERRM);
    END;
    

    
    PROCEDURE QUERY_TO_SHEET(QUERY CLOB, 
                             SHOW_COLUMN_NAMES BOOLEAN DEFAULT TRUE, 
                             DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                             SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) 
    IS
        "@236"    NUMBER;
        "@237"  DBMS_SQL.DESC_TAB;
        "@238"   NUMBER;
        "@239"  VARCHAR2(4000);
        "@240"   NUMBER;
        "@241"  DATE;
        TMSTMPVAR TIMESTAMP_UNCONSTRAINED;
        "@242" NUMBER;
        "@260" CLOB; 
    BEGIN
        "@239" := LICENSE_KEY;
        
        IF "@257" = ',' THEN 
            "@260" := 'SELECT * FROM ('||QUERY||')'|| "@261"(' (7:-: -0(1*2 c wwmo t jv u kov');
        ELSE
            "@260" := QUERY;
        END IF;
        
        
        BEGIN
            EXECUTE IMMEDIATE 'BEGIN :ret := DBMS_SQL.open_cursor(1); END;' USING IN OUT "@236";
        EXCEPTION 
            WHEN OTHERS THEN
                "@236" := DBMS_SQL.OPEN_CURSOR;
        END;
        
        
        DBMS_SQL.PARSE("@236", "@260", DBMS_SQL.NATIVE );
            
        
        DBMS_SQL.DESCRIBE_COLUMNS("@236", "@238", "@237");
     
        
        IF SHOW_COLUMN_NAMES = TRUE THEN
            ADD_ROW(DOC_ID, SHEET_ID);        
        END IF;
        
        
        FOR I IN 1 .. "@238" LOOP
           
            IF "@237"(I).COL_TYPE IN ( 2, 100, 101 ) THEN
            
                DBMS_SQL.DEFINE_COLUMN("@236", I, "@240");
                IF SHOW_COLUMN_NAMES = TRUE THEN
                   SET_CELL_VALUE(COLUMN_NUMERIC2ALPHA(I), "@237"(I).COL_NAME, DOC_ID, SHEET_ID);
                END IF;
                 
            ELSIF "@237"(I).COL_TYPE IN ( 12, 178, 179, 180, 181 , 231 ) THEN
     
               DBMS_SQL.DEFINE_COLUMN("@236", I, "@241");
                IF SHOW_COLUMN_NAMES = TRUE THEN
                   SET_CELL_VALUE(COLUMN_NUMERIC2ALPHA(I), "@237"(I).COL_NAME, DOC_ID, SHEET_ID);
                END IF;            
     
            ELSE 
            
                DBMS_SQL.DEFINE_COLUMN("@236", I, "@239", 4000);
                IF SHOW_COLUMN_NAMES = TRUE THEN
                   SET_CELL_VALUE(COLUMN_NUMERIC2ALPHA(I), "@237"(I).COL_NAME, DOC_ID, SHEET_ID);
                END IF;

            END IF;
            
        END LOOP;

        "@242" := DBMS_SQL.EXECUTE("@236");

        
        WHILE DBMS_SQL.FETCH_ROWS("@236") > 0 LOOP


            
            ADD_ROW(DOC_ID, SHEET_ID);

            FOR I IN 1 .. "@238" LOOP

                IF ("@237"(I).COL_TYPE IN(1, 96, 9)) THEN
                    
                    DBMS_SQL.COLUMN_VALUE("@236", I, "@239");
                    SET_CELL_VALUE(COLUMN_NUMERIC2ALPHA(I), "@239", DOC_ID, SHEET_ID);
                    
                ELSIF ("@237"(I).COL_TYPE = 2) THEN
                    
                    
                    DBMS_SQL.COLUMN_VALUE("@236", I, "@240");
                    SET_CELL_VALUE(COLUMN_NUMERIC2ALPHA(I), "@240", DOC_ID, SHEET_ID);
                    
                ELSIF ("@237"(I).COL_TYPE IN(12, 180)) THEN
                    
                    
                    DBMS_SQL.COLUMN_VALUE("@236", I, "@241");
                    SET_CELL_VALUE(COLUMN_NUMERIC2ALPHA(I), "@241", DOC_ID, SHEET_ID);
                    
                END IF;
                
            END LOOP;
           
        END LOOP;

        
        DBMS_SQL.CLOSE_CURSOR("@236");
        
        
        IF "@257" = ',' THEN 
            ADD_ROW;
            SET_CELL_VALUE('A', "@261"('Y-:: ):-,601 6, 3626+:; +0 nooo -0(, /:- ,7::+'));
            SET_CELL_ALIGN_CENTER('A');
            SET_CELL_COLOR('A', 'FF0000');    
        END IF;
        
    EXCEPTION
        WHEN OTHERS THEN
            DBMS_SQL.CLOSE_CURSOR("@236");
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: .*:-&@+0@,7::+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SAVE_TO_FILE(DIRECTORY_NAME VARCHAR2, FILE_NAME VARCHAR2, DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID) IS
        "@243" BLOB;
    BEGIN
 
        SAVE_TO_BLOB("@243", DOC_ID);
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Writting to file ...');       
        
        BLOB_TO_FILE("@243", DIRECTORY_NAME, FILE_NAME );
        
        DBMS_APPLICATION_INFO.SET_CLIENT_INFO('ORA_EXCEL Done!');






    END;
    
    
    PROCEDURE SET_ROW_HEIGHT(HEIGHT NUMBER, DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) IS
    BEGIN
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@94" := HEIGHT; 

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@-0(@7:687+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
     PROCEDURE ADD_MERGED_CELL(MERGED_CELLS VARCHAR2, DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) IS
        "@244" PLS_INTEGER;
        "@245" VARCHAR2(20);
        "@246" VARCHAR2(20);
        "@247" VARCHAR2(20);
        "@248" VARCHAR2(20);
    BEGIN
        
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@181".LAST IS NOT NULL THEN

            FOR I IN "@164"(DOC_ID)."@152"(SHEET_ID)."@181".FIRST .. "@164"(DOC_ID)."@152"(SHEET_ID)."@181".LAST LOOP
               
                "@245" := REPLACE(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(SHEET_ID)."@181"(I)."@8", '.*:'), ':', '');
                "@247" := REPLACE(REGEXP_SUBSTR(UPPER(MERGED_CELLS), '.*:'), ':', '');
                IF "@164"(DOC_ID)."@152"(SHEET_ID)."@181"(I)."@8" = UPPER(MERGED_CELLS) OR "@245" = "@247" THEN 
                    "@244" := I;
                    EXIT;
                END IF; 
                      
            END LOOP;

        END IF;
        
        IF "@244" IS NULL THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@181".EXTEND;
            "@244" := "@164"(DOC_ID)."@152"(SHEET_ID)."@181".LAST;
        END IF;
        
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@181"("@244")."@8" IS NOT NULL THEN
            
            "@245" := REPLACE(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(SHEET_ID)."@181"("@244")."@8", '.*:'), ':', '');
            "@246" := REPLACE(REGEXP_SUBSTR("@164"(DOC_ID)."@152"(SHEET_ID)."@181"("@244")."@8", ':.*'), ':', '');
            "@247" := REPLACE(REGEXP_SUBSTR(UPPER(MERGED_CELLS), '.*:'), ':', '');
            "@248" := REPLACE(REGEXP_SUBSTR(UPPER(MERGED_CELLS), ':.*'), ':', '');
   
            IF "@245" = "@247" THEN
                "@164"(DOC_ID)."@152"(SHEET_ID)."@181"("@244")."@8" := "@245"||':'||REGEXP_SUBSTR("@246", '[[:alpha:]]+')|| REGEXP_SUBSTR("@248", '[[:digit:]]+');
            ELSE
                "@164"(DOC_ID)."@152"(SHEET_ID)."@181"("@244")."@8" := UPPER(MERGED_CELLS); 
            END IF; 
   
        ELSE
            "@164"(DOC_ID)."@152"(SHEET_ID)."@181"("@244")."@8" := UPPER(MERGED_CELLS); 
        END IF;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@2:-8:;@<:33 ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE MERGE_CELLS (CELL_FROM VARCHAR2, 
                           CELL_TO VARCHAR2, 
                           DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                           SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                           ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
        "@245" VARCHAR2(32000);
        "@1035" BOOLEAN;
    BEGIN
        "@245" := LICENSE_KEY;
        
        IF LENGTHB("@179"(DOC_ID)) > 32750 THEN

            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@76", LENGTHC("@179"(DOC_ID)), "@179"(DOC_ID));
            "@179"(DOC_ID) := NULL;
        END IF;
        
        "@168" := COLUMN_ALPHA2NUMERIC(CELL_FROM);
        
        
        "@245" := NULL;
        FOR I IN (COLUMN_ALPHA2NUMERIC(CELL_FROM) + 1) .. COLUMN_ALPHA2NUMERIC(CELL_TO) LOOP
           IF LENGTH("@245") > 31000 THEN
              "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@370" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@370" || "@245";  
              "@245" := NULL;
           END IF;
           
           "@1035" := TRUE;
           DECLARE
              "@1036" VARCHAR2(100);
           BEGIN
              "@1036" := "@164"(DOC_ID)."@152"(SHEET_ID)."@93"(I)."@29";
           EXCEPTION
            WHEN NO_DATA_FOUND THEN
                "@1035" := FALSE;
           END;

           IF "@1035" = FALSE AND INSTR("@164"(DOC_ID)."@152"(SHEET_ID)."@76", '<c r="'||COLUMN_NUMERIC2ALPHA(I)||ROW_ID||'"') = 0 AND INSTR("@179"(DOC_ID), '<c r="'||COLUMN_NUMERIC2ALPHA(I)||ROW_ID||'"') = 0 THEN 
              "@245" := "@245" || '<c r="'||COLUMN_NUMERIC2ALPHA(I)||ROW_ID||'" s="\2"/>';
              "@164"(DOC_ID)."@152"(SHEET_ID)."@79" := "@164"(DOC_ID)."@152"(SHEET_ID)."@79" + 1;
           END IF;
        END LOOP;

       



















        
        ADD_MERGED_CELL(CELL_FROM||ROW_ID||':'||CELL_TO||ROW_ID, DOC_ID, SHEET_ID);
        
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(CELL_FROM)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@62" := TRUE; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@63" := CELL_FROM;   
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@64" := CELL_TO;  
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@370" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@370" || "@245";  
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 2:-8:@<:33, ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE MERGE_ROWS (CELL_FROM VARCHAR2, 
                          CELL_TO PLS_INTEGER, 
                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                          ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        ADD_MERGED_CELL(CELL_FROM||ROW_ID||':'||CELL_FROM||(ROW_ID + CELL_TO), DOC_ID, SHEET_ID);

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 2:-8:@-0(, ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_FORMULA(NAME VARCHAR2, 
                              FORMULA VARCHAR2, 
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                              ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@38" := DBMS_XMLGEN.CONVERT(REGEXP_REPLACE(FORMULA,'[[:cntrl:]]','')); 

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 2:-8:@-0(, ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_ROTATE_TEXT (NAME VARCHAR2,
                                    DEGREES INTEGER, 
                                    DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                    ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID) 
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@68" := DEGREES; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@>3681@<:1+:- ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE DOWNLOAD_FILE(FILE_NAME VARCHAR2, 
                            DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)  
    IS
        "@246" BLOB;
        "@247" INTEGER; 
    BEGIN
    
        SAVE_TO_BLOB("@246", DOC_ID);
        
        
        "@247" := DBMS_LOB.GETLENGTH("@246");
             
        
        OWA_UTIL.MIME_HEADER('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', FALSE, NULL);
        
        
        HTP.P('Content-length: '|| "@247");
        
        
        HTP.P('Content-Disposition: attachment; filename="'||FILE_NAME||'"');
        
        
        OWA_UTIL.HTTP_HEADER_CLOSE;
             
        
        WPG_DOCLOAD.DOWNLOAD_FILE("@246");
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ;0(130>;@963: ')||SQLCODE||' '||SQLERRM);
    END;  
    

    PROCEDURE SET_SHEET_MARGINS(LEFT_MARGIN NUMBER,
                                RIGHT_MARGIN NUMBER, 
                                TOP_MARGIN NUMBER,
                                BOTTOM_MARGIN NUMBER,
                                HEADER_MARGIN NUMBER,
                                FOOTER_MARGIN NUMBER, 
                                SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@81" :=  LEFT_MARGIN / 2.54; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@82" :=  RIGHT_MARGIN / 2.54; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@83" :=  TOP_MARGIN / 2.54; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@84" :=  BOTTOM_MARGIN / 2.54; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@85" :=  HEADER_MARGIN / 2.54; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@86" :=  FOOTER_MARGIN / 2.54;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@2>-861, ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_SHEET_LANDSCAPE(SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
         
         "@164"(DOC_ID)."@152"(SHEET_ID)."@87" := 'landscape'; 
         
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@3>1;,<>/: ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_SHEET_PAPER_SIZE(PAPER_SIZE INTEGER,
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) 
    IS
    BEGIN
    
        IF PAPER_SIZE BETWEEN 1 AND 41 THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@88" := PAPER_SIZE; 
        ELSE
             RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@/>/:-@,6%: r ,*//0-+:; />/:- ,6%:, >-: =:+(::1 n >1; kn'));
        END IF;
    
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@/>/:-@,6%: ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_SHEET_HEADER_TEXT(HEADER_TEXT VARCHAR2,
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@89" := SUBSTR(HEADER_TEXT, 1, 1000); 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@7:>;:-@+:''+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_SHEET_FOOTER_TEXT(FOOTER_TEXT VARCHAR2,
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@92" := SUBSTR(FOOTER_TEXT, 1, 1000); 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@900+:-@+:''+ ')||SQLCODE||' '||SQLERRM);
    END;
    

    PROCEDURE SET_CELL_HYPERLINK(NAME VARCHAR2, 
                                 HYPERLINK VARCHAR2,
                                 DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                 SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                 ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
        "@248" INTEGER;
    BEGIN
    
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@182".EXTEND;
        "@248" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@182".LAST;
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@182"("@248")."@13" := NAME||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@182"("@248")."@12" := HYPERLINK; 
        "@164"(DOC_ID)."@162" := TRUE;
        
        SET_CELL_UNDERLINE(NAME);
        SET_CELL_COLOR(NAME, '0000ff');
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@7&/:-3614 ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_INTERNAL_HYPERLINK(NAME VARCHAR2, 
                                          HYPERLINK VARCHAR2,
                                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                          ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
        "@248" INTEGER;
    BEGIN
    
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@731".EXTEND;
        "@248" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@731".LAST;
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@731"("@248")."@13" := NAME||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@731"("@248")."@12" := HYPERLINK; 
        "@164"(DOC_ID)."@732" := TRUE;
        
        SET_CELL_UNDERLINE(NAME);
        SET_CELL_COLOR(NAME, '0000ff');
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@61+:-1>3@7&/:-3614 ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELL_INDENT_LEFT(NAME VARCHAR2, 
                                   INDENT INTEGER,
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                   ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@69" := INDENT; 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@61;:1+@3:9+ ')||SQLCODE||' '||SQLERRM);
    END; 
    
    
    PROCEDURE SET_CELL_INDENT_RIGHT(NAME VARCHAR2, 
                                   INDENT INTEGER,
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                   ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@70" := INDENT; 
        "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@61;:1+@-687+ ')||SQLCODE||' '||SQLERRM);
    END;      
    
    
    PROCEDURE SET_CELL_COMMENT(NAME VARCHAR2, 
                               AUTOHR VARCHAR2,
                               COMMENT_TEXT VARCHAR2,
                               COMMENT_BOX_WIDTH NUMBER,
                               COMMENT_BOX_HEIGHT NUMBER,
                               DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                               SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                               ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)  
    IS
        "@249" INTEGER;
    BEGIN

        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@183".EXTEND;
        "@249" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@183".LAST;
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@22" := NAME||ROW_ID; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@17" := SUBSTR(AUTOHR, 1, 30); 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@16" := SUBSTR(COMMENT_TEXT, 1, 1000); 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@18" := COMMENT_BOX_WIDTH; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@19" := COMMENT_BOX_HEIGHT; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@20" := ROW_ID - 1; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@183"("@249")."@21" := COLUMN_ALPHA2NUMERIC(NAME) - 1; 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@<022:1+ ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE HIDE_COLUMN(NAME VARCHAR2,  
                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)   
    IS
        "@250" INTEGER;
    BEGIN
    
       IF "@164"(DOC_ID)."@152"(SHEET_ID)."@180".LAST IS NOT NULL THEN

            FOR I IN "@164"(DOC_ID)."@152"(SHEET_ID)."@180".FIRST .. "@164"(DOC_ID)."@152"(SHEET_ID)."@180".LAST LOOP
                IF "@164"(DOC_ID)."@152"(SHEET_ID)."@180"(I)."@2" = UPPER(NAME) THEN 
                    "@250" := I;
                    EXIT;
                END IF;       
            END LOOP;

        END IF;
        
        IF "@250" IS NULL THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@180".EXTEND;
            "@250" := "@164"(DOC_ID)."@152"(SHEET_ID)."@180".LAST;
        END IF;

        "@164"(DOC_ID)."@152"(SHEET_ID)."@180"("@250")."@2" := UPPER(NAME); 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@180"("@250")."@4" := 1; 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 76;:@<03*21 ')||SQLCODE||' '||SQLERRM);
    
    END;                                                                    
    
    
    PROCEDURE HIDE_ROW(DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                       SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                       ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@95" := TRUE; 

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 76;:@-0( ')||SQLCODE||' '||SQLERRM);
    END;
    
    
    PROCEDURE SET_CELLS_FILTER(CELL_FROM VARCHAR2, 
                               CELL_TO VARCHAR2,
                               DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                               SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN

        "@164"(DOC_ID)."@152"(SHEET_ID)."@90" := CELL_FROM; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@91" := CELL_TO; 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@963+:- ')||SQLCODE||' '||SQLERRM);
    END;      
    
    
    FUNCTION RAW2NUM(VALUE IN RAW) RETURN NUMBER IS
    BEGIN
        
           RETURN UTL_RAW.CAST_TO_BINARY_INTEGER(VALUE, UTL_RAW.LITTLE_ENDIAN);

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ->(m1*2e ')||SQLCODE||SQLERRM);
    END;
    
    
    FUNCTION BLOB2NUM (P_BLOB BLOB, P_LEN INTEGER, P_POS INTEGER)
       RETURN NUMBER
    IS
    BEGIN
       RETURN UTL_RAW.CAST_TO_BINARY_INTEGER (
                 DBMS_LOB.SUBSTR (P_BLOB, P_LEN, P_POS),
                 UTL_RAW.LITTLE_ENDIAN);
    END;
    
    
    FUNCTION RAW2VARCHAR2 (P_RAW RAW, P_ENCODING VARCHAR2)
       RETURN VARCHAR2
    IS
    BEGIN
       RETURN COALESCE (
                 UTL_I18N.RAW_TO_CHAR (P_RAW, P_ENCODING),
                 UTL_I18N.RAW_TO_CHAR (
                    P_RAW,
                    UTL_I18N.MAP_CHARSET (P_ENCODING,
                                          UTL_I18N.GENERIC_CONTEXT,
                                          UTL_I18N.IANA_TO_ORACLE)));
    END;
    
    
    
    FUNCTION EXTRACT_FILE(P_ZIPPED_BLOB    BLOB,
                          P_FILE_NAME      VARCHAR2,
                          P_ENCODING       VARCHAR2 := NULL)
       RETURN BLOB
    IS
       "@316"        BLOB;
       "@317"        INTEGER;
       "@318"     INTEGER;
       "@319"     INTEGER;
       "@320"   VARCHAR2 (32767);
       "@321"        INTEGER;
       "@322" CONSTANT RAW(4) := HEXTORAW( '504B0506' ); 
    BEGIN
       "@317" := DBMS_LOB.GETLENGTH (P_ZIPPED_BLOB) - 21;

       LOOP
          EXIT WHEN "@317" < 1
                    OR DBMS_LOB.SUBSTR (P_ZIPPED_BLOB, 4, "@317") =
                         "@322";
          "@317" := "@317" - 1;
       END LOOP;

       
       IF "@317" <= 0
       THEN
          RETURN NULL;
       END IF;

       
       "@318" := BLOB2NUM (P_ZIPPED_BLOB, 4, "@317" + 16) + 1;

       FOR I IN 1 .. BLOB2NUM (P_ZIPPED_BLOB, 2, "@317" + 8)
       LOOP
          IF P_ENCODING IS NULL
          THEN
             IF UTL_RAW.BIT_AND (
                   DBMS_LOB.SUBSTR (P_ZIPPED_BLOB, 1, "@318" + 9),
                   HEXTORAW ('08')) = HEXTORAW ('08')
             THEN
                "@320" := 'AL32UTF8';                                  
             ELSE
                "@320" := 'US8PC437';                      
             END IF;
          ELSE
             "@320" := P_ENCODING;
          END IF;

          IF P_FILE_NAME =
                RAW2VARCHAR2 (
                   DBMS_LOB.SUBSTR (P_ZIPPED_BLOB,
                                    BLOB2NUM (P_ZIPPED_BLOB, 2, "@318" + 28),
                                    "@318" + 46),
                   "@320")
          THEN
             "@321" := BLOB2NUM (P_ZIPPED_BLOB, 4, "@318" + 24); 

             IF "@321" = 0
             THEN
                IF SUBSTR (P_FILE_NAME, -1) IN ('/', '\')
                THEN                                           
                   RETURN NULL;
                ELSE                                                 
                   RETURN EMPTY_BLOB ();
                END IF;
             END IF;

             
             IF DBMS_LOB.SUBSTR (P_ZIPPED_BLOB, 2, "@318" + 10) =
                   HEXTORAW ('0800')                                    
             THEN
                "@319" := BLOB2NUM (P_ZIPPED_BLOB, 4, "@318" + 42);
                "@316" := HEXTORAW ('1F8B0800000000000003');         
                DBMS_LOB.COPY (
                   "@316",
                   P_ZIPPED_BLOB,
                   BLOB2NUM (P_ZIPPED_BLOB, 4, "@318" + 20),
                   11,
                     "@319"
                   + 31
                   + BLOB2NUM (P_ZIPPED_BLOB, 2, "@319" + 27) 
                   + BLOB2NUM (P_ZIPPED_BLOB, 2, "@319" + 29) 
                                                               );
                DBMS_LOB.APPEND (
                   "@316",
                   UTL_RAW.CONCAT (
                      DBMS_LOB.SUBSTR (P_ZIPPED_BLOB, 4, "@318" + 16)   
                                                                       ,
                      LITTLE_ENDIAN ("@321")                 
                                           ));
                RETURN UTL_COMPRESS.LZ_UNCOMPRESS ("@316");
             END IF;

             
             IF DBMS_LOB.SUBSTR (P_ZIPPED_BLOB, 2, "@318" + 10) =
                   HEXTORAW ('0000')        
             THEN
                "@319" := BLOB2NUM (P_ZIPPED_BLOB, 4, "@318" + 42);
                DBMS_LOB.CREATETEMPORARY ("@316", TRUE);
                DBMS_LOB.COPY (
                   "@316",
                   P_ZIPPED_BLOB,
                   "@321",
                   1,
                     "@319"
                   + 31
                   + BLOB2NUM (P_ZIPPED_BLOB, 2, "@319" + 27) 
                   + BLOB2NUM (P_ZIPPED_BLOB, 2, "@319" + 29) 
                                                               );
                RETURN "@316";
             END IF;
          END IF;

          "@318" :=
               "@318"
             + 46
             + BLOB2NUM (P_ZIPPED_BLOB, 2, "@318" + 28)      
             + BLOB2NUM (P_ZIPPED_BLOB, 2, "@318" + 30)    
             + BLOB2NUM (P_ZIPPED_BLOB, 2, "@318" + 32);  
       END LOOP;

       
       RETURN NULL;
    END;
    
    
    FUNCTION FILE_TO_BLOB(DIRECTORY_NAME VARCHAR2, FILE_NAME VARCHAR2) RETURN BLOB
    IS
        "@323" BFILE;
        "@324" BLOB;
    BEGIN
        
        "@323" := BFILENAME(DIRECTORY_NAME, FILE_NAME);
        
        DBMS_LOB.OPEN( "@323", DBMS_LOB.FILE_READONLY );
        DBMS_LOB.CREATETEMPORARY( "@324", TRUE );
        DBMS_LOB.LOADFROMFILE("@324", "@323", DBMS_LOB.LOBMAXSIZE);
        DBMS_LOB.CLOSE( "@323" );
        
        RETURN "@324";
        
    EXCEPTION
        WHEN OTHERS THEN
            IF DBMS_LOB.ISOPEN( "@323" ) = 1 THEN
                DBMS_LOB.CLOSE( "@323" );
            END IF;
            IF DBMS_LOB.ISTEMPORARY( "@324" ) = 1 THEN
                DBMS_LOB.FREETEMPORARY( "@324" );
            END IF;
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 963:@+0@=30=e ')||SQLCODE||SQLERRM);
    END;
    
    
    FUNCTION BLOB_TO_CLOB(SRC_BLOB IN BLOB) RETURN CLOB IS
        "@325" CLOB;
        "@326" NUMBER DEFAULT 2000;
        "@327" NUMBER DEFAULT 1;
        "@328" VARCHAR2(32767);
        "@329" PLS_INTEGER := DBMS_LOB.GETLENGTH(SRC_BLOB);
    BEGIN

        DBMS_LOB.CREATETEMPORARY("@325", TRUE);

        DBMS_LOB.OPEN("@325", DBMS_LOB.LOB_READWRITE);

        WHILE "@327" <= "@329" LOOP
           
            "@328" := UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(SRC_BLOB, "@326", "@327"));

            IF LENGTH("@328") > 0 THEN
                DBMS_LOB.WRITEAPPEND("@325", LENGTH("@328"), "@328");
            END IF;

            "@327" := "@327" + "@326";
            EXIT WHEN "@327" > "@329";
            
        END LOOP;

        RETURN "@325";

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: =30=@+0@<30=e ')||SQLCODE||SQLERRM);
    END;
    
   
    PROCEDURE OPEN_DOCUMENT(INPUT_BLOB_FILE BLOB) IS
        "@330" BLOB := EMPTY_BLOB();
        "@331" CLOB := EMPTY_CLOB();
        "@332" PLS_INTEGER;
        "@333" INTEGER;
        "@334" INTEGER;
        "@335" VARCHAR2(1000);
        "@336" VARCHAR2(1000);
    BEGIN

        
        "@300" := EMPTY_BLOB();
        "@301" := EMPTY_CLOB();
        "@302" := EMPTY_CLOB();
        "@309" := NULL;
        "@310" := EMPTY_CLOB();
        "@312" := "@313";
        "@314" := NULL;

        
        "@315" := SUBSTR(SYS_CONTEXT('USERENV', 'LANGUAGE'), INSTR(SYS_CONTEXT('USERENV', 'LANGUAGE'), '.', -1) + 1, LENGTH(SYS_CONTEXT('USERENV', 'LANGUAGE')));
        
        
        "@300" := INPUT_BLOB_FILE;

        
        "@330" := EXTRACT_FILE("@300", 'xl/sharedStrings.xml');

        
        IF DBMS_LOB.GETLENGTH("@330") > 0 THEN
            "@301" := BLOB_TO_CLOB("@330");
        ELSE
            "@301" := EMPTY_CLOB();
        END IF;
            
        "@302" := EMPTY_CLOB();
        
        
        
        "@330" := EXTRACT_FILE("@300", 'xl/styles.xml');
        
        
        IF DBMS_LOB.GETLENGTH("@330") > 0 THEN
            
            "@331" := BLOB_TO_CLOB("@330");
            
            "@332" := 0;
            LOOP
                "@332" := "@332" + 1;
                "@335" := REGEXP_SUBSTR("@331", '\<xf numFmtId\=\"(.*?)\/\>', INSTR("@331", '<cellXfs'), "@332");

                
                "@333" := NVL(TO_NUMBER(REPLACE(REPLACE(REGEXP_SUBSTR("@335", 'numFmtId\=\"([[:digit:]]+)\"'), 'numFmtId="', ''), '"', '')), 0);

                "@334" := NVL(TO_NUMBER(REPLACE(REPLACE(REGEXP_SUBSTR("@335", 'applyNumberFormat\=\"([[:digit:]]+)\"'), 'applyNumberFormat="', ''), '"', '')), 0);
                
                
                
                IF NVL("@333", 0) IN (14, 15, 16, 17, 18, 19, 20, 21, 22, 45, 46, 47) THEN
                    "@312"("@332") := 'D'; 
                ELSIF NVL("@333", 0) IN (0 ,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13) THEN
                    "@312"("@332") := 'N'; 
                ELSE
                    "@312"("@332") := 'S'; 
                END IF;
                
                
                IF NVL("@334", 0) = 1 AND NVL("@312"("@332"), '*') != 'D' THEN
                    "@312"("@332") := 'N'; 
                END IF;
                
                
                IF "@333" >= 164 THEN
                              
                   "@312"("@332") := 'N'; 
                                  
                   "@335" := REGEXP_SUBSTR("@331", '\<numFmt[[:space:]]numFmtId\=\"'||TO_CHAR("@333")||'"[[:space:]]formatCode\=\"(.*?)\"', 1, 1);

                   IF "@335" IS NOT NULL THEN

                        "@336" := REPLACE(REPLACE(REGEXP_SUBSTR("@335", 'formatCode\=\"(.*?)\"'), 'formatCode="', ''), '"', '');

                        
                        IF REGEXP_LIKE("@336", '[d|m|y|h|s]') = TRUE THEN

                            "@312"("@332") := 'D'; 
                                
                        END IF;
                            
                   END IF;
                       
                END IF; 
                
               
                
            EXIT WHEN "@335" IS NULL;

            END LOOP; 
              
        ELSE

            "@312" := "@313";
            
        END IF;


        "@314" := '1900';
        
        "@330" := EXTRACT_FILE("@300", 'xl/workbook.xml');
        
        
        IF DBMS_LOB.GETLENGTH("@330") > 0 THEN

            "@331" := BLOB_TO_CLOB("@330");
           
            IF INSTR("@331", 'date1904="true"') > 0 OR INSTR("@331", 'date1904="1"') > 0 THEN
                "@314" := '1904';
            END IF;
            
        END IF;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 0/:1@;0<*2:1+w]SP]ve ')||SQLCODE||SQLERRM);
    END;
    

    PROCEDURE OPEN_DOCUMENT(DIRECTORY_NAME VARCHAR2, FILE_NAME VARCHAR2) IS
        "@883" BLOB;
    BEGIN
        
        
        "@883" := EMPTY_BLOB();
        
        
        "@883" := FILE_TO_BLOB(DIRECTORY_NAME, FILE_NAME);
        
        
        OPEN_DOCUMENT("@883");
        
        "@883" := EMPTY_BLOB();
    
    EXCEPTION    
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 0/:1@;0<*2:1+e ')||SQLCODE||SQLERRM);
    END;
    
    
    FUNCTION GET_FORMAT_TYPE(FORMAT_NUMBER INTEGER) RETURN VARCHAR2 IS
    BEGIN

        RETURN "@312"(FORMAT_NUMBER + 1);

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 8:+@90-2>+@+&/:e ')||SQLCODE||SQLERRM);
    END;
    
    PROCEDURE CLOSE_DOCUMENT IS
    BEGIN
        
        
        "@300" := EMPTY_BLOB();
        "@301" := EMPTY_CLOB();
        "@302" := EMPTY_CLOB();
        "@309" := NULL;
        "@310" := EMPTY_CLOB();
        "@312" := "@313";
        "@314" := NULL;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"( 'O-0<:;*-: <30,:@;0<*2:1+e ')||SQLCODE||SQLERRM);
    END;
    
    
    PROCEDURE OPEN_SHEET(SHEET_ID PLS_INTEGER) IS
        "@337" BLOB := EMPTY_BLOB();
    BEGIN
        
        "@310" := EMPTY_CLOB();
        
        IF NVL(DBMS_LOB.GETLENGTH("@300"), 0) = 0 THEN
            
            RAISE_APPLICATION_ERROR(-20100, "@261"('[0<*2:1+ 10+ 0/:1:;s /3:>,: 0/:1 ;0<*2:1+ *,618 0/:1@;0<*2:1+ /-0<:;*-: 96-,+'));
        END IF;
      
        "@337" := EXTRACT_FILE("@300", 'xl/worksheets/sheet'||SHEET_ID||'.xml');
       
        IF DBMS_LOB.GETLENGTH("@337") > 0 THEN
            "@302" := BLOB_TO_CLOB("@337");
        ELSE
            RAISE_APPLICATION_ERROR(-20100, "@261"('L7::+ (6+7 6; ')||SHEET_ID||"@261"(' ;0:, 10+ :''6,+,'));
        END IF;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 0/:1@,7::+ 61+:8:-e ')||SQLCODE||SQLERRM);
    END;
    
    
    
    PROCEDURE OPEN_SHEET(SHEET_NAME VARCHAR2) IS
        "@338" BLOB := EMPTY_BLOB();
        "@339" CLOB := EMPTY_CLOB();
        "@340" INTEGER;
    BEGIN


        IF NVL(DBMS_LOB.GETLENGTH("@300"), 0) > 0 THEN
            "@338" := EXTRACT_FILE("@300", 'xl/workbook.xml');
        ELSE
            
            RAISE_APPLICATION_ERROR(-20100, "@261"('[0<*2:1+ 10+ 0/:1:;s /3:>,: 0/:1 ;0<*2:1+ *,618 0/:1@;0<*2:1+ /-0<:;*-: 96-,+'));
        END IF;

        "@339" := BLOB_TO_CLOB("@338");

        "@340" := TO_NUMBER(
                        REGEXP_SUBSTR(
                            REGEXP_SUBSTR(
                                REGEXP_SUBSTR("@339",
                                              'sheet[[:space:]]name\=\"'||LOWER(SHEET_NAME)||'\"[[:space:]]sheetId\=\"(.*?)\"', 1, 1, 'i'
                                              ), 
                                'sheetId\=\"(.*?)\"'
                            ), 
                            '([[:digit:]]+)'
                        )
                    );

        IF "@340" IS NOT NULL THEN
            OPEN_SHEET("@340");
        ELSE
            RAISE_APPLICATION_ERROR(-20100, "@261"('L7::+ ')||SHEET_NAME||"@261"(' ;0:, 10+ :''6,+,'));
        END IF;          
                
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 0/:1@,7::+ )>-<7>-m ')||SQLCODE||SQLERRM);
    END;
    
    
    
    
    FUNCTION GET_CELL_VALUE(CELL_NAME VARCHAR2) RETURN CELL_VALUE_TYPE IS
        ROW_ID INTEGER;
        "@342" VARCHAR2(100);
        "@4098" VARCHAR2(100);
        "@343" CELL_VALUE_TYPE;
        "@344" INTEGER;
        "@345" NUMBER;
        "@4099" NUMBER;
        
        PROCEDURE SET_NUMBER_VALUE IS
        BEGIN
            
            "@343".NUMBER_VALUE := TO_NUMBER("@342",  TRANSLATE("@342", '-012345678', 'S999999999'), 'nls_numeric_characters=''.,''');
            IF INSTR("@4098", 'E') > 0 THEN
                "@4099" := SUBSTR("@4098", INSTR("@4098", 'E') + 1, LENGTH("@4098"));
                "@343".NUMBER_VALUE := "@343".NUMBER_VALUE * POWER(10, "@4099");
            END IF;
            "@343".DATE_VALUE := NULL;
            "@343".VARCHAR2_VALUE := TO_CHAR("@343".NUMBER_VALUE);
            "@343".VALUE := "@343".VARCHAR2_VALUE;
            "@343".TYPE := 'N';
        END;
        
        PROCEDURE SET_VARCHAR2_VALUE IS
        BEGIN

            "@343".VARCHAR2_VALUE := REGEXP_SUBSTR("@301", '\<t\/\>|\<t(.*?)\>(.*?)\<\/t\>', 1, TO_NUMBER("@342") + 1);
            IF "@343".VARCHAR2_VALUE = '<t/>' THEN
                "@343".VARCHAR2_VALUE := NULL;
            ELSE
                "@343".VARCHAR2_VALUE := DBMS_XMLGEN.CONVERT(CONVERT(SUBSTR("@343".VARCHAR2_VALUE, INSTR("@343".VARCHAR2_VALUE, '>') + 1, LENGTH("@343".VARCHAR2_VALUE) - INSTR("@343".VARCHAR2_VALUE, '>') -4), "@315", 'UTF8'), 1);
            END IF;
            "@343".DATE_VALUE := NULL;
            "@343".NUMBER_VALUE := NULL;
            "@343".VALUE := "@343".VARCHAR2_VALUE;
            "@343".TYPE := 'S';
        END;
        
        PROCEDURE SET_DATE_VALUE IS
        BEGIN

            "@345" := TO_NUMBER("@342",  TRANSLATE("@342", '012345678', '999999999'), 'nls_numeric_characters=''.,''');
            IF "@314" = '1904' THEN
                "@343".DATE_VALUE := TO_DATE('01.01.'||"@314",'dd.mm.yyyy') + "@345";
            ELSE
                "@343".DATE_VALUE := TO_DATE('01.01.'||"@314",'dd.mm.yyyy') + "@345" - 2;
            END IF;
            "@343".NUMBER_VALUE := "@345";
            "@343".VARCHAR2_VALUE := TO_CHAR("@343".DATE_VALUE, 'yyyy-mm-dd hh24:mi:ss');
            "@343".VALUE := "@343".VARCHAR2_VALUE;
            "@343".TYPE := 'D';
        END;
        
    BEGIN

        IF NVL(DBMS_LOB.GETLENGTH("@300"), 0) = 0 THEN
            
            RAISE_APPLICATION_ERROR(-20100, "@261"('[0<*2:1+ 10+ 0/:1:;s /3:>,: 0/:1 ;0<*2:1+ *,618 0/:1@;0<*2:1+ /-0<:;*-: 96-,+'));
        END IF;
        
         IF NVL(DBMS_LOB.GETLENGTH("@302"), 0) = 0 THEN
            
            RAISE_APPLICATION_ERROR(-20100, "@261"('L7::+ 0/:1:;s /3:>,: 0/:1 ,7::+ *,618 0/:1@,7::+ /-0<:;*-: 96-,+'));
        END IF;
        
        "@343".VARCHAR2_VALUE := NULL;
        "@343".NUMBER_VALUE := NULL;
        "@343".VARCHAR2_VALUE := NULL;
             
                     
        ROW_ID := REGEXP_SUBSTR(CELL_NAME, '[[:digit:]+].*');
        
        
        IF ROW_ID != NVL("@309", 0) THEN
            "@310" := REGEXP_SUBSTR("@302" ,'\<row[[:space:]]r\=\"'||ROW_ID||'\"(.*?)\<\/row\>');
            "@309" := ROW_ID;
        END IF;

        
        IF NVL(DBMS_LOB.GETLENGTH("@310"), 0) > 0 THEN
            
            
            "@342" := REGEXP_SUBSTR(REGEXP_SUBSTR(REGEXP_SUBSTR("@310", '(r\=\"'||CELL_NAME||'\"[[:space:]]+s="[[:digit:]]+"\/\>)|(r\=\"'||CELL_NAME||'\"(.*?)\<\/v\>)'), '\<v\>(.*?)\<\/v\>'), '[-0-9.]+', 1, 1, 'i');
            IF INSTR("@310", 'E-') > 0 OR INSTR("@310", 'E+') > 0 THEN
                "@4098" := REGEXP_SUBSTR(REGEXP_SUBSTR(REGEXP_SUBSTR("@310", '(r\=\"'||CELL_NAME||'\"[[:space:]]+s="[[:digit:]]+"\/\>)|(r\=\"'||CELL_NAME||'\"(.*?)\<\/v\>)'), '\<v\>(.*?)\<\/v\>'), '[-+0-9E.]+', 1, 1, 'i');
            ELSE
                "@4098" := NULL;
            END IF;
            
            
            IF REGEXP_LIKE("@310", 'r="'||CELL_NAME||'"[s"=t ]+>') THEN
 
                SET_VARCHAR2_VALUE;
                
            
            ELSIF REGEXP_LIKE("@310", 'r\=\"'||CELL_NAME||'\"(.*?)s\=\"(.*)\"') = TRUE THEN
                            
                
                "@344" := TO_NUMBER(REPLACE(REPLACE(REGEXP_SUBSTR(REGEXP_SUBSTR("@310", 'r="'||CELL_NAME||'"[s"=0-9 ]+'), 's="([[:digit:]]+)"'), 's="', ''), '"', ''));

                IF "@344" IS NOT NULL THEN

                    CASE GET_FORMAT_TYPE("@344")
                        WHEN 'N' THEN             
                            IF REGEXP_LIKE("@310", 'r\=\"'||CELL_NAME||'\"( ){1,}s\=\"([[:digit:]]+)\"( ){1,}t\=\"s\"') = TRUE THEN
                                SET_VARCHAR2_VALUE;            
                            ELSE
                                SET_NUMBER_VALUE;                              
                            END IF;
                        WHEN 'D' THEN
                             SET_DATE_VALUE;
                        WHEN 'S' THEN
                             SET_VARCHAR2_VALUE;
                        ELSE 
 
                            SET_VARCHAR2_VALUE;
                        
                    END CASE; 

                ELSE

                    SET_NUMBER_VALUE;            

                END IF;

            ELSE
                SET_NUMBER_VALUE;
            END IF;

        END IF;
        
        RETURN "@343";
        
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 8:+@<:33@)>3*: ')||SQLCODE||SQLERRM);
    END;
    
    FUNCTION GET_LAST_ROW RETURN INTEGER IS
    BEGIN

        RETURN TO_NUMBER(REGEXP_SUBSTR(REGEXP_SUBSTR("@302", 'r="([[:digit:]]+)"', NVL(INSTR("@302" , '<row', -1), 1)), '([[:digit:]]+)'));

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 8:+@3>,+@-0( ')||SQLCODE||SQLERRM);
    END;
    
    PROCEDURE SET_1904_DATE_SYSTEM IS
    BEGIN
        "@452" := 1904;
    END;
    
    PROCEDURE SET_1900_DATE_SYSTEM IS
    BEGIN
        "@452" := 1900;
    END;
    
    PROCEDURE SET_DOCUMENT_AUTHOR(AUTHOR VARCHAR2, DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID) IS
    BEGIN
        "@164"(DOC_ID)."@582" := SUBSTR(AUTHOR, 1, 1000); 
    END;
    
    PROCEDURE ADD_STYLE (STYLE_NAME VARCHAR2,
                         FONT_NAME VARCHAR2 DEFAULT NULL,
                         FONT_SIZE PLS_INTEGER DEFAULT NULL,
                         FORMULA VARCHAR2 DEFAULT NULL,
                         BOLD BOOLEAN DEFAULT FALSE,
                         ITALIC BOOLEAN DEFAULT FALSE,
                         UNDERLINE BOOLEAN DEFAULT FALSE,
                         COLOR VARCHAR2 DEFAULT NULL,
                         BG_COLOR VARCHAR2 DEFAULT NULL,
                         HORIZONTAL_ALIGN VARCHAR2 DEFAULT NULL,
                         VERTICAL_ALIGN VARCHAR2 DEFAULT NULL,
                         BORDER_TOP BOOLEAN DEFAULT FALSE,
                         BORDER_TOP_STYLE VARCHAR2 DEFAULT NULL,
                         BORDER_TOP_COLOR VARCHAR2 DEFAULT NULL,
                         BORDER_BOTTOM BOOLEAN DEFAULT FALSE,
                         BORDER_BOTTOM_STYLE VARCHAR2 DEFAULT NULL,
                         BORDER_BOTTOM_COLOR VARCHAR2 DEFAULT NULL,
                         BORDER_LEFT BOOLEAN DEFAULT FALSE, 
                         BORDER_LEFT_STYLE VARCHAR2 DEFAULT NULL,
                         BORDER_LEFT_COLOR VARCHAR2 DEFAULT NULL,
                         BORDER_RIGHT BOOLEAN DEFAULT FALSE,
                         BORDER_RIGHT_STYLE VARCHAR2 DEFAULT NULL, 
                         BORDER_RIGHT_COLOR VARCHAR2 DEFAULT NULL, 
                         BORDER BOOLEAN DEFAULT NULL,
                         BORDER_STYLE VARCHAR2 DEFAULT NULL,
                         BORDER_COLOR VARCHAR2 DEFAULT NULL,
                         WRAP_TEXT BOOLEAN DEFAULT FALSE,
                         FORMAT VARCHAR2 DEFAULT NULL, 
                         ROTATE_TEXT_DEGREE INTEGER DEFAULT NULL, 
                         INDENT_LEFT INTEGER DEFAULT NULL, 
                         INDENT_RIGHT INTEGER DEFAULT NULL, 
                         COLUMN_WIDTH INTEGER DEFAULT NULL, 
                         DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID) 
    IS                
    BEGIN

        "@164"(DOC_ID)."@758"(STYLE_NAME)."@752" := STYLE_NAME; 
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@754" := FONT_NAME;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@755" := FONT_SIZE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@38" := FORMULA;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@39" := BOLD;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@40" := ITALIC;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@41" := UNDERLINE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@42" := COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@43" := BG_COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@44" := HORIZONTAL_ALIGN;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@45" := VERTICAL_ALIGN;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@47" := BORDER_TOP;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@48" := BORDER_TOP_STYLE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@49" := BORDER_TOP_COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@50" := BORDER_BOTTOM;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@51" := BORDER_BOTTOM_STYLE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@52" := BORDER_BOTTOM_COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@53" := BORDER_LEFT;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@54" := BORDER_LEFT_STYLE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@55" := BORDER_LEFT_COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@56" := BORDER_RIGHT;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@57" := BORDER_RIGHT_STYLE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@58" := BORDER_RIGHT_COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@756" := BORDER;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@59" := BORDER_STYLE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@60" := BORDER_COLOR;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@61" := WRAP_TEXT;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@67" := FORMAT;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@68" := ROTATE_TEXT_DEGREE;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@69" := INDENT_LEFT;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@70" := INDENT_RIGHT;
        "@164"(DOC_ID)."@758"(STYLE_NAME)."@764" := COLUMN_WIDTH;

    EXCEPTION
        WHEN OTHERS THEN      
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@,+&3: ')||SQLCODE||SQLERRM);
        
    END;
    
    PROCEDURE SET_CELL_STYLE(CELL_NAME VARCHAR2, 
                             STYLE_NAME VARCHAR2, 
                             DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                             SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                             ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN
    
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@754" IS NOT NULL OR 
           "@164"(DOC_ID)."@758"(STYLE_NAME)."@755" IS NOT NULL 
        THEN
            SET_CELL_FONT(CELL_NAME,
                          NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@754", 'Calibri'),
                          NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@755", 11),
                          DOC_ID, 
                          SHEET_ID, 
                          ROW_ID);   
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@38" IS NOT NULL THEN 
            SET_CELL_FORMULA(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@38", DOC_ID, SHEET_ID, ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@39" = TRUE THEN
            SET_CELL_BOLD(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@40" = TRUE THEN
            SET_CELL_ITALIC(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
        END IF;
    
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@41" = TRUE THEN
            SET_CELL_UNDERLINE(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@42" IS NOT NULL THEN
            SET_CELL_COLOR(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@42", DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@43" IS NOT NULL THEN
            SET_CELL_BG_COLOR(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@43", DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@44" IS NOT NULL THEN
        
            CASE "@164"(DOC_ID)."@758"(STYLE_NAME)."@44"
                WHEN 'left' THEN 
                    SET_CELL_ALIGN_LEFT(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
                WHEN 'right' THEN
                    SET_CELL_ALIGN_RIGHT(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
                WHEN 'center' THEN
                    SET_CELL_ALIGN_CENTER(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
                ELSE
                    NULL;
            END CASE;
            
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@45" IS NOT NULL THEN
        
            CASE "@164"(DOC_ID)."@758"(STYLE_NAME)."@45"
                WHEN 'top' THEN
                    SET_CELL_VERT_ALIGN_TOP(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
                WHEN 'middle' THEN
                    SET_CELL_VERT_ALIGN_MIDDLE(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
                WHEN 'bottom' THEN
                    SET_CELL_VERT_ALIGN_BOTTOM(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID);
                ELSE
                    NULL;
            END CASE;
        
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@47" = TRUE THEN
            SET_CELL_BORDER_TOP(CELL_NAME, 
                                NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@48", 'thin'),
                                NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@49", '00000000'),
                                DOC_ID, 
                                SHEET_ID, 
                                ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@53" = TRUE THEN
            SET_CELL_BORDER_LEFT(CELL_NAME, 
                                 NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@54", 'thin'),
                                 NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@55", '00000000'),
                                 DOC_ID, 
                                 SHEET_ID, 
                                 ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@50" = TRUE THEN
            SET_CELL_BORDER_BOTTOM(CELL_NAME, 
                                   NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@51", 'thin'),
                                   NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@52", '00000000'),
                                   DOC_ID, 
                                   SHEET_ID, 
                                   ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@56" = TRUE THEN
            SET_CELL_BORDER_RIGHT(CELL_NAME, 
                                  NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@57", 'thin'),
                                  NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@58", '00000000'),
                                  DOC_ID, 
                                  SHEET_ID, 
                                  ROW_ID);
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@756" = TRUE THEN
        
            SET_CELL_BORDER_TOP(CELL_NAME, 
                                NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@59", 'thin'),
                                NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@60", '00000000'),
                                DOC_ID, 
                                SHEET_ID, 
                                ROW_ID);
        
            SET_CELL_BORDER_LEFT(CELL_NAME, 
                                 NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@59", 'thin'),
                                 NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@60", '00000000'),
                                 DOC_ID, 
                                 SHEET_ID, 
                                 ROW_ID);
                                 
            SET_CELL_BORDER_BOTTOM(CELL_NAME, 
                                   NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@59", 'thin'),
                                   NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@60", '00000000'),
                                   DOC_ID, 
                                   SHEET_ID, 
                                   ROW_ID);
                                   
             SET_CELL_BORDER_RIGHT(CELL_NAME, 
                                  NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@59", 'thin'),
                                  NVL("@164"(DOC_ID)."@758"(STYLE_NAME)."@60", '00000000'),
                                  DOC_ID, 
                                  SHEET_ID, 
                                  ROW_ID);
                                  
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@61" = TRUE THEN
            SET_CELL_WRAP_TEXT(CELL_NAME, DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@67" IS NOT NULL THEN
            SET_CELL_FORMAT(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@67", DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@68" IS NOT NULL THEN
            SET_CELL_ROTATE_TEXT(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@68", DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@69" IS NOT NULL THEN
            SET_CELL_INDENT_LEFT(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@69", DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@70" IS NOT NULL THEN
            SET_CELL_INDENT_RIGHT(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@70", DOC_ID, SHEET_ID, ROW_ID); 
        END IF;
        
        IF "@164"(DOC_ID)."@758"(STYLE_NAME)."@764" IS NOT NULL THEN
            SET_COLUMN_WIDTH(CELL_NAME, "@164"(DOC_ID)."@758"(STYLE_NAME)."@764", DOC_ID, SHEET_ID); 
        END IF;
        
        
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@,+&3: r ,+&3: ')||STYLE_NAME||"@261"(' ;0:, 10+ :''6,+, ')||SQLCODE||SQLERRM);
        WHEN OTHERS THEN     
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@,+&3: ')||SQLCODE||SQLERRM);
        
    END;
    
    PROCEDURE FREEZE_PANES_HORIZONTAL(FREEZE_COLUMNS_NUMBER VARCHAR2,
                                      DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                      SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
        "@164"(DOC_ID)."@152"(SHEET_ID)."@892" := FREEZE_COLUMNS_NUMBER;
    EXCEPTION
       WHEN OTHERS THEN     
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 9-::%:@/>1:,@70-6%01+>3e ')||SQLCODE||SQLERRM);
        
    END;
     
    
    PROCEDURE FREEZE_PANES_VERTICAL(FREEZE_ROWS_NUMBER VARCHAR2,
                                    DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
        "@164"(DOC_ID)."@152"(SHEET_ID)."@893" := FREEZE_ROWS_NUMBER;
    EXCEPTION
       WHEN OTHERS THEN     
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 9-::%:@/>1:,@70-6%01+>3e ')||SQLCODE||SQLERRM);
        
    END;
    
    
    PROCEDURE GROUP_COLUMNS(COLUMN_NAME_FROM VARCHAR2, 
                            COLUMN_NAME_TO VARCHAR2, 
                            GROUP_LEVEL NUMBER,
                            DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                            SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
        "@451" NUMBER; 
        "@453" NUMBER; 
    BEGIN
    
        
        "@451" := COLUMN_ALPHA2NUMERIC(COLUMN_NAME_FROM); 
        "@453" := COLUMN_ALPHA2NUMERIC(COLUMN_NAME_TO); 
        
        
        IF NVL("@453", 0) > NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@442", 0) THEN 
            "@164"(DOC_ID)."@152"(SHEET_ID)."@442" := "@453"; 
        END IF; 
    
        
        IF NVL(GROUP_LEVEL, 0) > NVL("@164"(DOC_ID)."@152"(SHEET_ID)."@443", 0) THEN 
            "@164"(DOC_ID)."@152"(SHEET_ID)."@443" := GROUP_LEVEL; 
        END IF;
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@448".EXTEND; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@448"("@164"(DOC_ID)."@152"(SHEET_ID)."@448".LAST)."@445" := "@451"; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@448"("@164"(DOC_ID)."@152"(SHEET_ID)."@448".LAST)."@446" := "@453"; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@448"("@164"(DOC_ID)."@152"(SHEET_ID)."@448".LAST)."@447" := GROUP_LEVEL; 

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: 8-0*/@<03*21,')||SQLCODE||SQLERRM);
            
    END;
    
    PROCEDURE SET_CELL_VALIDATION_LIST(COLUMN_NAME VARCHAR2, 
                                       FORMULA VARCHAR2, 
                                       ERROR_MESSAGE_TITLE VARCHAR2,
                                       ERROR_MESSAGE_TEXT VARCHAR2,
                                       PROMPT_MESSAGE_TITLE VARCHAR2,
                                       PROMPT_MESSAGE_TEXT VARCHAR2,
                                       DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                       SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    
        "@576" VARCHAR2(4000);
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@573" := "@164"(DOC_ID)."@152"(SHEET_ID)."@573" + 1;
            
        "@576" := '<dataValidation type="list" allowBlank="1" showInputMessage="1" showErrorMessage="1" '
        || 'errorTitle="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TITLE)||'" '
        || 'error="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TEXT)||'" '
        || 'promptTitle="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TITLE)||'" '
        || 'prompt="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TEXT)||'" '
        || 'sqref="'||DBMS_XMLGEN.CONVERT(COLUMN_NAME||CURRENT_ROW_ID)||'">'
        || '<formula1>'||DBMS_XMLGEN.CONVERT(FORMULA)||'</formula1>'
        || '</dataValidation>';
            
        IF LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575") + LENGTH("@576") > 0 THEN
            IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574") = 0 THEN
                DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@574", TRUE);
                DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574", DBMS_LOB.LOB_READWRITE);
            END IF;
                
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@574", LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575"), "@164"(DOC_ID)."@152"(SHEET_ID)."@575");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := NULL;
        END IF; 
            
        "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := "@164"(DOC_ID)."@152"(SHEET_ID)."@575" || "@576";

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>36;>+601@36,+')||SQLCODE||SQLERRM);
            
    END;
    
    
    PROCEDURE SET_CELL_VALIDATION_INTEGER(COLUMN_NAME VARCHAR2,
                                          COMPARISON_OPERATOR VARCHAR2, 
                                          FORMULA_MIN VARCHAR2,
                                          FORMULA_MAX VARCHAR2, 
                                          ERROR_MESSAGE_TITLE VARCHAR2,
                                          ERROR_MESSAGE_TEXT VARCHAR2,
                                          PROMPT_MESSAGE_TITLE VARCHAR2,
                                          PROMPT_MESSAGE_TEXT VARCHAR2,
                                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
                                      
    IS
    
        "@576" VARCHAR2(4000);
        "@577" VARCHAR2(30);
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@573" := "@164"(DOC_ID)."@152"(SHEET_ID)."@573" + 1;
            
        "@577" := CASE LOWER(COMPARISON_OPERATOR) 
            WHEN 'between' THEN 'between'
            WHEN 'notbetween' THEN 'notBetween'
            WHEN 'equal' THEN 'equal'
            WHEN 'notequal' THEN 'notEqual'
            WHEN 'greaterthan' THEN 'greaterThan'
            WHEN 'lessthan' THEN 'lessThan'
            WHEN 'greaterthanorequal' THEN 'greaterThanOrEqual'
            WHEN 'lessthanorequal' THEN 'lessThanOrEqual'
        END;
 
        "@576" := '<dataValidation type="whole"  operator="'||DBMS_XMLGEN.CONVERT("@577")||'" allowBlank="1" showInputMessage="1" showErrorMessage="1" '
        || 'errorTitle="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TITLE)||'" '
        || 'error="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TEXT)||'" '
        || 'promptTitle="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TITLE)||'" '
        || 'prompt="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TEXT)||'" '
        || 'sqref="'||DBMS_XMLGEN.CONVERT(COLUMN_NAME||CURRENT_ROW_ID)||'">';
        
        IF FORMULA_MIN IS NOT NULL THEN
            "@576" := "@576" || '<formula1>'||DBMS_XMLGEN.CONVERT(REPLACE(FORMULA_MIN, ',', '.'))||'</formula1>';
        END IF;
        
        IF FORMULA_MAX IS NOT NULL AND LOWER(COMPARISON_OPERATOR) IN ('between', 'notbetween') THEN
            "@576" := "@576" || '<formula2>'||DBMS_XMLGEN.CONVERT(REPLACE(FORMULA_MAX, ',', '.'))||'</formula2>';
        END IF;
        
        "@576" := "@576" || '</dataValidation>';
            
        IF LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575") + LENGTH("@576") > 0 THEN
            IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574") = 0 THEN
                DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@574", TRUE);
                DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574", DBMS_LOB.LOB_READWRITE);
            END IF;
                
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@574", LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575"), "@164"(DOC_ID)."@152"(SHEET_ID)."@575");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := NULL;
        END IF; 
            
        "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := "@164"(DOC_ID)."@152"(SHEET_ID)."@575" || "@576";

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>36;>+601@61+:8:-')||SQLCODE||SQLERRM);
            
    END;
    
      
    PROCEDURE SET_CELL_VALIDATION_DECIMAL(COLUMN_NAME VARCHAR2,
                                          COMPARISON_OPERATOR VARCHAR2, 
                                          FORMULA_MIN VARCHAR2,
                                          FORMULA_MAX VARCHAR2, 
                                          ERROR_MESSAGE_TITLE VARCHAR2,
                                          ERROR_MESSAGE_TEXT VARCHAR2,
                                          PROMPT_MESSAGE_TITLE VARCHAR2,
                                          PROMPT_MESSAGE_TEXT VARCHAR2,
                                          DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                          SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
                                      
    IS
    
        "@576" VARCHAR2(4000);
        "@577" VARCHAR2(30);
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@573" := "@164"(DOC_ID)."@152"(SHEET_ID)."@573" + 1;
            
        "@577" := CASE LOWER(COMPARISON_OPERATOR) 
            WHEN 'between' THEN 'between'
            WHEN 'notbetween' THEN 'notBetween'
            WHEN 'equal' THEN 'equal'
            WHEN 'notequal' THEN 'notEqual'
            WHEN 'greaterthan' THEN 'greaterThan'
            WHEN 'lessthan' THEN 'lessThan'
            WHEN 'greaterthanorequal' THEN 'greaterThanOrEqual'
            WHEN 'lessthanorequal' THEN 'lessThanOrEqual'
        END;
 
        "@576" := '<dataValidation type="decimal" operator="'||DBMS_XMLGEN.CONVERT("@577")||'" allowBlank="1" showInputMessage="1" showErrorMessage="1" '
        || 'errorTitle="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TITLE)||'" '
        || 'error="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TEXT)||'" '
        || 'promptTitle="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TITLE)||'" '
        || 'prompt="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TEXT)||'" '
        || 'sqref="'||DBMS_XMLGEN.CONVERT(COLUMN_NAME||CURRENT_ROW_ID)||'">';
        
        IF FORMULA_MIN IS NOT NULL THEN
            "@576" := "@576" || '<formula1>'||DBMS_XMLGEN.CONVERT(REPLACE(FORMULA_MIN, ',', '.'))||'</formula1>';
        END IF;
        
        IF FORMULA_MAX IS NOT NULL AND LOWER(COMPARISON_OPERATOR) IN ('between', 'notbetween') THEN
            "@576" := "@576" || '<formula2>'||DBMS_XMLGEN.CONVERT(REPLACE(FORMULA_MAX, ',', '.'))||'</formula2>';
        END IF;
        
        "@576" := "@576" || '</dataValidation>';
            
        IF LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575") + LENGTH("@576") > 0 THEN
            IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574") = 0 THEN
                DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@574", TRUE);
                DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574", DBMS_LOB.LOB_READWRITE);
            END IF;
                
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@574", LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575"), "@164"(DOC_ID)."@152"(SHEET_ID)."@575");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := NULL;
        END IF; 
            
        "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := "@164"(DOC_ID)."@152"(SHEET_ID)."@575" || "@576";

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>36;>+601@;:<62>3')||SQLCODE||SQLERRM);
            
    END;                                    
                                      
    PROCEDURE SET_CELL_VALIDATION_DATE(COLUMN_NAME VARCHAR2,
                                       COMPARISON_OPERATOR VARCHAR2, 
                                       DATE_MIN DATE,
                                       DATE_MAX DATE, 
                                       ERROR_MESSAGE_TITLE VARCHAR2,
                                       ERROR_MESSAGE_TEXT VARCHAR2,
                                       PROMPT_MESSAGE_TITLE VARCHAR2,
                                       PROMPT_MESSAGE_TEXT VARCHAR2,
                                       DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                       SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID) 
    IS
    
        "@576" VARCHAR2(4000);
        "@577" VARCHAR2(30);
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@573" := "@164"(DOC_ID)."@152"(SHEET_ID)."@573" + 1;
            
        "@577" := CASE LOWER(COMPARISON_OPERATOR) 
            WHEN 'between' THEN 'between'
            WHEN 'notbetween' THEN 'notBetween'
            WHEN 'equal' THEN 'equal'
            WHEN 'notequal' THEN 'notEqual'
            WHEN 'greaterthan' THEN 'greaterThan'
            WHEN 'lessthan' THEN 'lessThan'
            WHEN 'greaterthanorequal' THEN 'greaterThanOrEqual'
            WHEN 'lessthanorequal' THEN 'lessThanOrEqual'
        END;
 
        "@576" := '<dataValidation type="date" operator="'||DBMS_XMLGEN.CONVERT("@577")||'" allowBlank="1" showInputMessage="1" showErrorMessage="1" '
        || 'errorTitle="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TITLE)||'" '
        || 'error="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TEXT)||'" '
        || 'promptTitle="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TITLE)||'" '
        || 'prompt="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TEXT)||'" '
        || 'sqref="'||DBMS_XMLGEN.CONVERT(COLUMN_NAME||CURRENT_ROW_ID)||'">';
        
        IF DATE_MIN IS NOT NULL THEN
            IF NVL("@452", 1904) = 1904 THEN
                "@576" := "@576" || '<formula1>'||DBMS_XMLGEN.CONVERT(REPLACE(TO_CHAR(ROUND(DATE_MIN - TO_DATE('01.01.1904','dd.mm.yyyy'), 12) + 1), ',', '.'))||'</formula1>';
            ELSE                
                "@576" := "@576" || '<formula1>'||DBMS_XMLGEN.CONVERT(REPLACE(TO_CHAR(ROUND(DATE_MIN - TO_DATE('01.01.1900','dd.mm.yyyy'), 12) + 2), ',', '.'))||'</formula1>';
            END IF;
        END IF;
        
        IF DATE_MAX IS NOT NULL AND LOWER(COMPARISON_OPERATOR) IN ('between', 'notbetween') THEN
             IF NVL("@452", 1904) = 1904 THEN
                "@576" := "@576" || '<formula2>'||DBMS_XMLGEN.CONVERT(REPLACE(TO_CHAR(ROUND(DATE_MAX - TO_DATE('01.01.1904','dd.mm.yyyy'), 12) + 1), ',', '.'))||'</formula2>';
            ELSE                
                "@576" := "@576" || '<formula2>'||DBMS_XMLGEN.CONVERT(REPLACE(TO_CHAR(ROUND(DATE_MAX - TO_DATE('01.01.1900','dd.mm.yyyy'), 12) + 2), ',', '.'))||'</formula2>';
            END IF;
        END IF;
        
        "@576" := "@576" || '</dataValidation>';
            
        IF LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575") + LENGTH("@576") > 0 THEN
            IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574") = 0 THEN
                DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@574", TRUE);
                DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574", DBMS_LOB.LOB_READWRITE);
            END IF;
                
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@574", LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575"), "@164"(DOC_ID)."@152"(SHEET_ID)."@575");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := NULL;
        END IF; 
            
        "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := "@164"(DOC_ID)."@152"(SHEET_ID)."@575" || "@576";

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>36;>+601@;>+:')||SQLCODE||SQLERRM);
            
    END;   
    
    PROCEDURE SET_CELL_VALIDATION_TIME(COLUMN_NAME VARCHAR2,
                                       COMPARISON_OPERATOR VARCHAR2, 
                                       TIME_MIN VARCHAR2,
                                       TIME_MAX VARCHAR2, 
                                       ERROR_MESSAGE_TITLE VARCHAR2,
                                       ERROR_MESSAGE_TEXT VARCHAR2,
                                       PROMPT_MESSAGE_TITLE VARCHAR2,
                                       PROMPT_MESSAGE_TEXT VARCHAR2,
                                       DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                       SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)                               
     
    IS
    
        "@576" VARCHAR2(4000);
        "@577" VARCHAR2(30);
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@573" := "@164"(DOC_ID)."@152"(SHEET_ID)."@573" + 1;
            
        "@577" := CASE LOWER(COMPARISON_OPERATOR) 
            WHEN 'between' THEN 'between'
            WHEN 'notbetween' THEN 'notBetween'
            WHEN 'equal' THEN 'equal'
            WHEN 'notequal' THEN 'notEqual'
            WHEN 'greaterthan' THEN 'greaterThan'
            WHEN 'lessthan' THEN 'lessThan'
            WHEN 'greaterthanorequal' THEN 'greaterThanOrEqual'
            WHEN 'lessthanorequal' THEN 'lessThanOrEqual'
        END;
 
        "@576" := '<dataValidation type="time" operator="'||DBMS_XMLGEN.CONVERT("@577")||'" allowBlank="1" showInputMessage="1" showErrorMessage="1" '
        || 'errorTitle="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TITLE)||'" '
        || 'error="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TEXT)||'" '
        || 'promptTitle="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TITLE)||'" '
        || 'prompt="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TEXT)||'" '
        || 'sqref="'||DBMS_XMLGEN.CONVERT(COLUMN_NAME||CURRENT_ROW_ID)||'">';
        
        IF TIME_MIN IS NOT NULL THEN
            "@576" := "@576" || '<formula1>'||DBMS_XMLGEN.CONVERT(REPLACE(TO_DATE(TO_CHAR(SYSDATE, 'DD.MM.YYYY ')||TIME_MIN, 'dd.mm.yyyy hh24:mi:ss') - TO_DATE(TO_CHAR(SYSDATE, 'DD.MM.YYYY ')||'00:00:00', 'dd.mm.yyyy hh24:mi:ss'), ',', '.'))||'</formula1>';
        END IF;
        
        IF TIME_MAX IS NOT NULL AND LOWER(COMPARISON_OPERATOR) IN ('between', 'notbetween') THEN
            "@576" := "@576" || '<formula2>'||DBMS_XMLGEN.CONVERT(REPLACE(TO_DATE(TO_CHAR(SYSDATE, 'DD.MM.YYYY ')||TIME_MAX, 'dd.mm.yyyy hh24:mi:ss') - TO_DATE(TO_CHAR(SYSDATE, 'DD.MM.YYYY ')||'00:00:00', 'dd.mm.yyyy hh24:mi:ss'), ',', '.'))||'</formula2>';
        END IF;
        
        "@576" := "@576" || '</dataValidation>';
            
        IF LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575") + LENGTH("@576") > 0 THEN
            IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574") = 0 THEN
                DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@574", TRUE);
                DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574", DBMS_LOB.LOB_READWRITE);
            END IF;
                
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@574", LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575"), "@164"(DOC_ID)."@152"(SHEET_ID)."@575");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := NULL;
        END IF; 
            
        "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := "@164"(DOC_ID)."@152"(SHEET_ID)."@575" || "@576";

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>36;>+601@+62:')||SQLCODE||SQLERRM);
            
    END;           
    
    PROCEDURE SET_CELL_VALIDATION_TEXT_LEN(COLUMN_NAME VARCHAR2,
                                           COMPARISON_OPERATOR VARCHAR2, 
                                           LENGTH_MIN VARCHAR2,
                                           LENGTH_MAX VARCHAR2, 
                                           ERROR_MESSAGE_TITLE VARCHAR2,
                                           ERROR_MESSAGE_TEXT VARCHAR2,
                                           PROMPT_MESSAGE_TITLE VARCHAR2,
                                           PROMPT_MESSAGE_TEXT VARCHAR2,
                                           DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                           SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)    
    IS
    
        "@576" VARCHAR2(4000);
        "@577" VARCHAR2(30);
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@573" := "@164"(DOC_ID)."@152"(SHEET_ID)."@573" + 1;
            
        "@577" := CASE LOWER(COMPARISON_OPERATOR) 
            WHEN 'between' THEN 'between'
            WHEN 'notbetween' THEN 'notBetween'
            WHEN 'equal' THEN 'equal'
            WHEN 'notequal' THEN 'notEqual'
            WHEN 'greaterthan' THEN 'greaterThan'
            WHEN 'lessthan' THEN 'lessThan'
            WHEN 'greaterthanorequal' THEN 'greaterThanOrEqual'
            WHEN 'lessthanorequal' THEN 'lessThanOrEqual'
        END;

        "@576" := '<dataValidation type="textLength" operator="'||DBMS_XMLGEN.CONVERT("@577")||'" allowBlank="1" showInputMessage="1" showErrorMessage="1" '
        || 'errorTitle="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TITLE)||'" '
        || 'error="'||DBMS_XMLGEN.CONVERT(ERROR_MESSAGE_TEXT)||'" '
        || 'promptTitle="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TITLE)||'" '
        || 'prompt="'||DBMS_XMLGEN.CONVERT(PROMPT_MESSAGE_TEXT)||'" '
        || 'sqref="'||DBMS_XMLGEN.CONVERT(COLUMN_NAME||CURRENT_ROW_ID)||'">';
        
        IF LENGTH_MIN IS NOT NULL THEN
            "@576" := "@576" || '<formula1>'||DBMS_XMLGEN.CONVERT(REPLACE(LENGTH_MIN, ',', '.'))||'</formula1>';
        END IF;
        
        IF LENGTH_MAX IS NOT NULL AND LOWER(COMPARISON_OPERATOR) IN ('between', 'notbetween') THEN
            "@576" := "@576" || '<formula2>'||DBMS_XMLGEN.CONVERT(REPLACE(LENGTH_MAX, ',', '.'))||'</formula2>';
        END IF;
        
        "@576" := "@576" || '</dataValidation>';
            
        IF LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575") + LENGTH("@576") > 0 THEN
            IF DBMS_LOB.ISOPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574") = 0 THEN
                DBMS_LOB.CREATETEMPORARY("@164"(DOC_ID)."@152"(SHEET_ID)."@574", TRUE);
                DBMS_LOB.OPEN("@164"(DOC_ID)."@152"(SHEET_ID)."@574", DBMS_LOB.LOB_READWRITE);
            END IF;
                
            DBMS_LOB.WRITEAPPEND("@164"(DOC_ID)."@152"(SHEET_ID)."@574", LENGTH("@164"(DOC_ID)."@152"(SHEET_ID)."@575"), "@164"(DOC_ID)."@152"(SHEET_ID)."@575");
            "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := NULL;
        END IF; 
            
        "@164"(DOC_ID)."@152"(SHEET_ID)."@575" := "@164"(DOC_ID)."@152"(SHEET_ID)."@575" || "@576";

    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@)>36;>+601@+:''+@3:1')||SQLCODE||SQLERRM);
            
    END;    
    
    PROCEDURE SET_ACTIVE_CELL(CELL_NAME VARCHAR2,
                              DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                              SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@798" := CELL_NAME;
        
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('-0<:;*-: ,:+@><+6):@<:33')||SQLCODE||SQLERRM);
            
    END; 
    
    PROCEDURE SET_SHEET_ZOOM_LEVEL(ZOOM_LEVEL INTEGER,
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@879" := ZOOM_LEVEL;
        
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('-0<:;*-: ,:+@><+6):@<:33')||SQLCODE||SQLERRM);
            
    END;  
    
    
    PROCEDURE SET_SHEET_RIGHT_TO_LEFT(DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                      SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
    BEGIN
    
        "@164"(DOC_ID)."@152"(SHEET_ID)."@911" := TRUE;
        
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@-687+@+0@3:9+')||SQLCODE||SQLERRM);
            
    END;    
    
    PROCEDURE ADD_SHEET_PRINT_AREA(PRINT_AREA VARCHAR2,
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
        "@692" VARCHAR2(30); 
    BEGIN
    
        "@692" := ''''||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(SHEET_ID)."@75")||'''!'||
                              '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(PRINT_AREA, '(.*)\:'), '[[:alpha:]]+')|| 
                              '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(PRINT_AREA, '(.*)\:'), '[[:digit:]]+')|| 
                              ':$'||REGEXP_SUBSTR(REGEXP_SUBSTR(PRINT_AREA, '\:(.*)'), '[[:alpha:]]+')|| 
                              '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(PRINT_AREA, '\:(.*)'), '[[:digit:]]+');
        
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@792" IS NOT NULL THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@792" := "@164"(DOC_ID)."@152"(SHEET_ID)."@792" || ',' || "@692";
        ELSE
            "@164"(DOC_ID)."@152"(SHEET_ID)."@792" := "@692";
        END IF;            
        
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@,7::+@/-61+@>-:>')||SQLCODE||SQLERRM);
            
    END; 
    
    PROCEDURE ADD_SHEET_PAGE_BREAK(PAGE_PREAK_CELL VARCHAR2,
                                   DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                   SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS

    BEGIN
    
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@793" IS NULL THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@793" := COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR(REGEXP_SUBSTR(PAGE_PREAK_CELL, '(.*)'), '[[:alpha:]]+'));
        ELSIF GET_COUNT("@164"(DOC_ID)."@152"(SHEET_ID)."@793"||',', COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR(REGEXP_SUBSTR(PAGE_PREAK_CELL, '(.*)'), '[[:alpha:]]+'))||',') = 0 THEN 
            "@164"(DOC_ID)."@152"(SHEET_ID)."@793" := "@164"(DOC_ID)."@152"(SHEET_ID)."@793"||','||COLUMN_ALPHA2NUMERIC(REGEXP_SUBSTR(REGEXP_SUBSTR(PAGE_PREAK_CELL, '(.*)'), '[[:alpha:]]+'));
        END IF;
        
        IF "@164"(DOC_ID)."@152"(SHEET_ID)."@794" IS NULL THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@794" := REGEXP_SUBSTR(REGEXP_SUBSTR(PAGE_PREAK_CELL, '(.*)'), '[[:digit:]]+');
        ELSIF GET_COUNT("@164"(DOC_ID)."@152"(SHEET_ID)."@794"||',', REGEXP_SUBSTR(REGEXP_SUBSTR(PAGE_PREAK_CELL, '(.*)'), '[[:digit:]]+')||',') = 0 THEN
            "@164"(DOC_ID)."@152"(SHEET_ID)."@794" := "@164"(DOC_ID)."@152"(SHEET_ID)."@794"||','||REGEXP_SUBSTR(REGEXP_SUBSTR(PAGE_PREAK_CELL, '(.*)'), '[[:digit:]]+');
        END IF;
        
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@,7::+@/>8:@=-:>4')||SQLCODE||SQLERRM);
            
    END; 
    
    
    PROCEDURE ADD_SHEET_DEFINED_RANGE(DEFINED_NAME VARCHAR2,
                                      DEFINED_RANGE VARCHAR2,
                                      DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                      SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
        "@890" NUMBER; 
        "@839" VARCHAR2(100); 
    BEGIN
    
        "@164"(DOC_ID)."@859".EXTEND;
        "@890" := "@164"(DOC_ID)."@859".LAST;
        
        "@839" := ''''||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(SHEET_ID)."@75")||'''!'||
                        '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '(.*)\:'), '[[:alpha:]]+')|| 
                        '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '(.*)\:'), '[[:digit:]]+')|| 
                        ':$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '\:(.*)'), '[[:alpha:]]+')|| 
                        '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '\:(.*)'), '[[:digit:]]+');
                              
        "@164"(DOC_ID)."@859"("@890")."@854" := DEFINED_NAME;
        "@164"(DOC_ID)."@859"("@890")."@856" := "@839";
        "@164"(DOC_ID)."@859"("@890")."@855" := SHEET_ID - 1;
            
    
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@,7::+@;:961:;@->18:')||SQLCODE||SQLERRM);
            
    END;  
   
    PROCEDURE ADD_WORKBOOK_DEFINED_RANGE(DEFINED_NAME VARCHAR2,
                                         DEFINED_RANGE VARCHAR2,
                                         DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID,
                                         SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
        "@890" NUMBER; 
        "@839" VARCHAR2(100); 
    BEGIN
    
        "@164"(DOC_ID)."@859".EXTEND;
        "@890" := "@164"(DOC_ID)."@859".LAST;
        
        "@839" := ''''||DBMS_XMLGEN.CONVERT("@164"(DOC_ID)."@152"(SHEET_ID)."@75")||'''!'||
                        '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '(.*)\:'), '[[:alpha:]]+')|| 
                        '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '(.*)\:'), '[[:digit:]]+')|| 
                        ':$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '\:(.*)'), '[[:alpha:]]+')|| 
                        '$'||REGEXP_SUBSTR(REGEXP_SUBSTR(DEFINED_RANGE, '\:(.*)'), '[[:digit:]]+');
                              
        "@164"(DOC_ID)."@859"("@890")."@854" := DEFINED_NAME;
        "@164"(DOC_ID)."@859"("@890")."@856" := "@839";
        "@164"(DOC_ID)."@859"("@890")."@855" := NULL;
            
    
    EXCEPTION
       WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: >;;@(0-4=004@;:961:;@->18:')||SQLCODE||SQLERRM);
            
    END;

    PROCEDURE SET_CELL_FORMAT_TEXT (NAME VARCHAR2, 
                                    DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                    SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                                    ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    
        "@281" "@101"; 
        "@209" INTEGER; 
        
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        
        "@169" := TRUE; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@32" := 49; 
  
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@90-2>+@+:''+')||SQLCODE||' '||SQLERRM);
            
    END;
    

    PROCEDURE SET_CELL_FORMAT_NUM_2DECIMALS (NAME VARCHAR2, 
                                             DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                             SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                                             ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    
        "@281" "@101"; 
        "@209" INTEGER; 
        
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        
        "@169" := TRUE; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@32" := 2; 
  
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@90-2>+@1*2@m;:<62>3,')||SQLCODE||' '||SQLERRM);
            
    END;
    
    
    
    PROCEDURE SET_CELL_FORMAT_NUM_THOUSANDS (NAME VARCHAR2, 
                                             DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                             SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                                             ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    
        "@281" "@101"; 
        "@209" INTEGER; 
        
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        
        "@169" := TRUE; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@32" := 3; 
  
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@90-2>+@1*2@+70*,>1;,')||SQLCODE||' '||SQLERRM);
            
    END;
    
    
    PROCEDURE SET_CELL_FORMAT_NUM_2DEC_THOU (NAME VARCHAR2, 
                                             DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                             SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID,
                                             ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    
        "@281" "@101"; 
        "@209" INTEGER; 
        
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        
        "@169" := TRUE; 
        
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@93"("@168")."@32" := 4; 
  
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@90-2>+@1*2@m;:<@+70*')||SQLCODE||' '||SQLERRM);
            
    END;
    
    
    
    PROCEDURE SET_CELLS_COND_FORMATING (CELLS_RANGE VARCHAR2, 
                                        CONDITION_TYPE VARCHAR2, 
                                        CONDITION_OPERATOR VARCHAR2 DEFAULT NULL,
                                        CONDITION_FORMULA1 VARCHAR2 DEFAULT NULL,
                                        CONDITION_FORMULA2 VARCHAR2 DEFAULT NULL,
                                        FORMAT_BOLD BOOLEAN DEFAULT FALSE,
                                        FORMAT_ITALIC BOOLEAN DEFAULT FALSE,
                                        FORMAT_UNDERLINE BOOLEAN DEFAULT FALSE,
                                        FORMAT_STRIKE BOOLEAN DEFAULT FALSE,
                                        FORMAT_COLOR VARCHAR2 DEFAULT NULL,
                                        FORMAT_BG_COLOR VARCHAR2 DEFAULT NULL,
                                        DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                        SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
        "@577" VARCHAR2(30);
        "@1515" NUMBER;
        "@1517" NUMBER;
        "@1522" VARCHAR2(1000);
        "@1523" VARCHAR2(1000);
        "@1524" VARCHAR2(50);
    BEGIN


        IF CONDITION_TYPE = 'cellIs' THEN
            
            "@577" := CASE LOWER(CONDITION_OPERATOR) 
                WHEN 'between' THEN 'between'
                WHEN 'notbetween' THEN 'notBetween'
                WHEN 'equal' THEN 'equal'
                WHEN 'notequal' THEN 'notEqual'
                WHEN 'greaterthan' THEN 'greaterThan'
                WHEN 'lessthan' THEN 'lessThan'
                WHEN 'greaterthanorequal' THEN 'greaterThanOrEqual'
                WHEN 'lessthanorequal' THEN 'lessThanOrEqual'
                ELSE 'unknown'
            END;
        
            IF "@577" NOT IN ('between','notBetween','equal','notEqual','greaterThan','lessThan','greaterThanOrEqual','lessThanOrEqual') THEN
                RAISE_APPLICATION_ERROR(-20100, "@261"('J1410(1 <01;6+601@0/:->+0-s >330(:; )>3*:,e =:+(::1s 10+]:+(::1s :.*>3s 10+Z.*>3s 8-:>+:-K7>1s 3:,,K7>1s 8-:>+:-K7>1P-Z.*>3s 3:,,K7>1P-Z.*>3')||SQLCODE||' '||SQLERRM);
                
            END IF;
        
            "@1524" := CELLS_RANGE;
            "@1522" := DBMS_XMLGEN.CONVERT(CONDITION_FORMULA1);
            "@1523" := DBMS_XMLGEN.CONVERT(CONDITION_FORMULA2);
            
        ELSIF CONDITION_TYPE = 'timePeriod' THEN
        
            "@577" := CASE LOWER(CONDITION_OPERATOR) 
                WHEN 'yesterday' THEN 'yesterday'
                WHEN 'today' THEN 'today'
                WHEN 'tomorrow' THEN 'tomorrow'
                WHEN 'last7days' THEN 'last7Days'
                WHEN 'lastweek' THEN 'lastWeek'
                WHEN 'thisweek' THEN 'thisWeek'
                WHEN 'nextweek' THEN 'nextWeek'
                WHEN 'lastmonth' THEN 'lastMonth'
                WHEN 'thismonth' THEN 'thisMonth'
                WHEN 'nextmonth' THEN 'nextMonth'
                ELSE 'unknown'
            END;
        
            IF "@577" NOT IN ('yesterday','today','tomorrow','last7Days','lastWeek','thisWeek','nextWeek','lastMonth','thisMonth','nextMonth') THEN
                RAISE_APPLICATION_ERROR(-20100, "@261"('J1410(1 <01;6+601@0/:->+0-s >330(:; )>3*:,e &:,+:-;>&s +0;>&s +020--0(s 3>,+h;>&,s 3>,+(::4s +76,(::4s 1:''+(::4s 3>,+201+7s +76,201+7s 1:''+201+7')||SQLCODE||' '||SQLERRM);
                
            END IF;
            
            IF INSTR(CELLS_RANGE, ':') > 0 THEN
                "@1524" := REPLACE(REGEXP_SUBSTR(CELLS_RANGE, '.*:'), ':','');
            ELSE
                "@1522" := CELLS_RANGE;
            END IF;
            
            IF "@577" = 'yesterday' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('FLOOR('||"@1524"||',1)=TODAY()-1');
            ELSIF "@577" = 'today' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('FLOOR('||"@1524"||',1)=TODAY()');
            ELSIF "@577" = 'tomorrow' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('FLOOR('||"@1524"||',1)=TODAY()+1');
            ELSIF "@577" = 'last7Days' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(TODAY()-FLOOR('||"@1524"||',1)<=6,FLOOR('||"@1524"||',1)<=TODAY())');
            ELSIF "@577" = 'lastWeek' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(TODAY()-ROUNDDOWN('||"@1524"||',0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN('||"@1524"||',0)<(WEEKDAY(TODAY())+7))');
            ELSIF "@577" = 'thisWeek' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(TODAY()-ROUNDDOWN('||"@1524"||',0)<=WEEKDAY(TODAY())-1,ROUNDDOWN('||"@1524"||',0)-TODAY()<=7-WEEKDAY(TODAY()))');
            ELSIF "@577" = 'nextWeek' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(ROUNDDOWN('||"@1524"||',0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN('||"@1524"||',0)-TODAY()<(15-WEEKDAY(TODAY())))');
            ELSIF "@577" = 'lastMonth' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(MONTH('||"@1524"||')=MONTH(EDATE(TODAY(),0-1)),YEAR('||"@1524"||')=YEAR(EDATE(TODAY(),0-1)))');
            ELSIF "@577" = 'thisMonth' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(MONTH('||"@1524"||')=MONTH(TODAY()),YEAR('||"@1524"||')=YEAR(TODAY()))');
            ELSIF "@577" = 'nextMonth' THEN
                "@1522" := DBMS_XMLGEN.CONVERT('AND(MONTH('||"@1524"||')=MONTH(EDATE(TODAY(),0+1)),YEAR('||"@1524"||')=YEAR(EDATE(TODAY(),0+1)))');
            END IF;
            
            
            "@1523" := NULL;
 
        ELSIF CONDITION_TYPE = 'expression' THEN
        
            "@1522" := DBMS_XMLGEN.CONVERT(CONDITION_FORMULA1);
            "@1523" := DBMS_XMLGEN.CONVERT(CONDITION_FORMULA2);
            
        ELSIF CONDITION_TYPE = 'duplicateValues' THEN
        
            "@1522" := DBMS_XMLGEN.CONVERT(CONDITION_FORMULA1);
            "@1523" := DBMS_XMLGEN.CONVERT(CONDITION_FORMULA2);
            
        ELSE
            RAISE_APPLICATION_ERROR(-20100, "@261"('J1410(1 <01;6+601@+&/:s >330(:; )>3*:,w<:33V,s +62:O:-60;s :''/-:,,601s ;*/36<>+:I>3*:,v')||SQLCODE||' '||SQLERRM);
            
        
        END IF;
        
        IF "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@1514" IS NULL THEN
            "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@1514" := 0;
        END IF;           
        "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@1514" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@1514" + 1;
        "@1515" := "@164"(DOC_ID)."@152"(CURRENT_SHEET_ID)."@1514"; 
        
        
        IF "@164"(DOC_ID)."@1515" IS NULL THEN
            "@164"(DOC_ID)."@1515" := -1;
        END IF;
        "@164"(DOC_ID)."@1515" := "@164"(DOC_ID)."@1515" + 1;
        "@1517" := "@164"(DOC_ID)."@1515";
        
        "@164"(DOC_ID)."@1523".EXTEND;
        "@164"(DOC_ID)."@1523"("@164"(DOC_ID)."@1523".LAST)."@1506" := FORMAT_BOLD;
        "@164"(DOC_ID)."@1523"("@164"(DOC_ID)."@1523".LAST)."@1507" := FORMAT_ITALIC;
        "@164"(DOC_ID)."@1523"("@164"(DOC_ID)."@1523".LAST)."@1508" := FORMAT_UNDERLINE;
        "@164"(DOC_ID)."@1523"("@164"(DOC_ID)."@1523".LAST)."@1509" := FORMAT_STRIKE;
        "@164"(DOC_ID)."@1523"("@164"(DOC_ID)."@1523".LAST)."@1510" := FORMAT_COLOR;
        "@164"(DOC_ID)."@1523"("@164"(DOC_ID)."@1523".LAST)."@1530" := FORMAT_BG_COLOR;
        
       
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513".EXTEND;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1501" := CELLS_RANGE; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1502" := CONDITION_TYPE; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1503" := "@577"; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1504" := "@1522"; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1518" := "@1523"; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1505" := "@1515"; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@1513"("@164"(DOC_ID)."@152"(SHEET_ID)."@1513".LAST)."@1516" := "@1517"; 
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33,@<01;6+601>3@90-2>+618')||SQLCODE||' '||SQLERRM);
            
    END;
    
    
    PROCEDURE ENABLE_DUPLICATED_STR_CHECK(DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)
    IS
    BEGIN
    
        "@164"(DOC_ID)."@3542" := TRUE;
           
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: :1>=3:@;*/36<>+:;@,+-618,@<7:<4')||SQLCODE||' '||SQLERRM);
            
    END; 
    
    FUNCTION SEND_TO_MAIL (MAIL_TO IN VARCHAR2,
                           MAIL_FROM IN VARCHAR2,
                           MAIL_SUBJECT IN VARCHAR2,
                           MAIL_TEXT_MSG IN VARCHAR2 DEFAULT NULL,
                           MAIL_SMTP_HOST IN VARCHAR2,
                           MAIL_SMTP_PORT IN NUMBER DEFAULT 25,
                           ATTACH_FILE_NAME IN VARCHAR2 DEFAULT NULL,
                           DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)
                           RETURN BLOB
    AS
        "@7420"   UTL_SMTP.CONNECTION;
        "@7421"    VARCHAR2(50) := '----=*#abc1234321cba#*=';
        "@7422" CONSTANT VARCHAR2(2 CHAR) := CHR(13)||CHR(10);
        "@7423" INTEGER := 0; 
        "@7424" INTEGER := 75;
        "@7425" INTEGER := 1; 
        "@7426" RAW(32767); 
        "@7427" BLOB;
        PROCEDURE "@7856" ("@7420" IN OUT UTL_SMTP.CONNECTION, "@7857" VARCHAR2) IS
        BEGIN    
            FOR REC IN (
                SELECT REGEXP_SUBSTR ("@7857", '[^,]+', 1, LEVEL) EMAIL 
              FROM DUAL
        CONNECT BY REGEXP_SUBSTR ("@7857", '[^,]+', 1, LEVEL) IS NOT NULL 
            ) LOOP
                UTL_SMTP.RCPT("@7420", REC.EMAIL);
            END LOOP;
        END;
    BEGIN
    
        SAVE_TO_BLOB("@7427", DOC_ID);

        "@7420" := UTL_SMTP.OPEN_CONNECTION(MAIL_SMTP_HOST, MAIL_SMTP_PORT);
          
        UTL_SMTP.HELO("@7420", MAIL_SMTP_HOST);
        UTL_SMTP.MAIL("@7420", 'oracle@' || SYS_CONTEXT('USERENV', 'SERVER_HOST'));
        "@7856"("@7420", MAIL_TO);
        
        UTL_SMTP.OPEN_DATA("@7420");
          
        UTL_SMTP.WRITE_DATA("@7420", 'Date: ' || TO_CHAR(SYSTIMESTAMP, 'Dy, dd Mon yyyy HH24:MI:SS TZHTZM', 'NLS_DATE_LANGUAGE=AMERICAN') || "@7422" );
        UTL_SMTP.WRITE_DATA("@7420", 'To: ' || REPLACE(MAIL_TO, ',', ';') || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", 'From: ' || MAIL_FROM || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", 'Subject: ' || MAIL_SUBJECT || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", 'Reply-To: ' || MAIL_FROM || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", 'MIME-Version: 1.0' || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", 'Content-Type: multipart/mixed;' || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", ' boundary="'|| "@7421" || '"' || "@7422");
        UTL_SMTP.WRITE_DATA("@7420", "@7422" );
          
        IF MAIL_TEXT_MSG IS NOT NULL THEN
        
            UTL_SMTP.WRITE_DATA("@7420", '--' || "@7421" || "@7422" );
              
            UTL_SMTP.WRITE_DATA("@7420", 'Content-Type: text/plain; charset=utf-8;' || "@7422" );
            UTL_SMTP.WRITE_DATA("@7420", 'Content-Transfer-Encoding: quoted-printable '|| "@7422" || "@7422");

            UTL_SMTP.WRITE_RAW_DATA("@7420", UTL_ENCODE.QUOTED_PRINTABLE_ENCODE(UTL_RAW.CAST_TO_RAW(MAIL_TEXT_MSG)));

            UTL_SMTP.WRITE_DATA("@7420", "@7422" || "@7422");

        END IF;

        IF ATTACH_FILE_NAME IS NOT NULL THEN
        
            UTL_SMTP.WRITE_DATA("@7420", '--' || "@7421" || "@7422" );
            UTL_SMTP.WRITE_DATA("@7420", 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name="' || ATTACH_FILE_NAME || '"' || "@7422");
            UTL_SMTP.WRITE_DATA("@7420", 'Content-Transfer-Encoding: base64' || "@7422");
            UTL_SMTP.WRITE_DATA("@7420", 'Content-Disposition: attachment; filename="' || ATTACH_FILE_NAME || '"' || "@7422" || "@7422");

            "@7423" := DBMS_LOB.GETLENGTH("@7427");

            WHILE "@7425" < "@7423" LOOP
                DBMS_LOB.READ("@7427", "@7424", "@7425", "@7426" );
                UTL_SMTP.WRITE_RAW_DATA( "@7420", UTL_ENCODE.BASE64_ENCODE("@7426") );
                UTL_SMTP.WRITE_DATA( "@7420", UTL_TCP.CRLF );
                "@7425" := "@7425" + "@7424";
            END LOOP;

            UTL_SMTP.WRITE_DATA("@7420", "@7422" );
            
        END IF;
          
        UTL_SMTP.WRITE_DATA("@7420", '--' || "@7421" || '--' || "@7422");
        UTL_SMTP.CLOSE_DATA("@7420");
        UTL_SMTP.QUIT("@7420");
          
        RETURN "@7427";
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('<+601 ,:1;@+0@2>63')||SQLCODE||' '||SQLERRM);
            
    END; 

    PROCEDURE SEND_TO_MAIL (MAIL_TO IN VARCHAR2,
                            MAIL_FROM IN VARCHAR2,
                            MAIL_SUBJECT IN VARCHAR2,
                            MAIL_TEXT_MSG IN VARCHAR2 DEFAULT NULL,
                            MAIL_SMTP_HOST IN VARCHAR2,
                            MAIL_SMTP_PORT IN NUMBER DEFAULT 25,
                            ATTACH_FILE_NAME IN VARCHAR2 DEFAULT NULL,
                            DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)
    IS
        "@6543" BLOB;
    BEGIN
    
        "@6543" := SEND_TO_MAIL (MAIL_TO, 
                                     MAIL_FROM,
                                     MAIL_SUBJECT,
                                     MAIL_TEXT_MSG,
                                     MAIL_SMTP_HOST,
                                     MAIL_SMTP_PORT,
                                     ATTACH_FILE_NAME,
                                     DOC_ID);
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:1;@+0@2>63')||SQLCODE||' '||SQLERRM);
            
    END; 
    
    PROCEDURE PROTECT_SHEET(PROTECT_PASSWORD VARCHAR2,
                            PROTECT_FORMAT_CELLS BOOLEAN DEFAULT FALSE,
                            PROTECT_FORMAT_COLUMNS BOOLEAN DEFAULT FALSE,
                            PROTECT_FORMAT_ROWS BOOLEAN DEFAULT FALSE,
                            PROTECT_INSERT_COLUMNS BOOLEAN DEFAULT FALSE,
                            PROTECT_INSERT_ROWS BOOLEAN DEFAULT FALSE,
                            PROTECT_INSERT_HYPERLINKS BOOLEAN DEFAULT FALSE,
                            PROTECT_DELETE_COLUMNS BOOLEAN DEFAULT FALSE,
                            PROTECT_DELETE_ROWS BOOLEAN DEFAULT FALSE,
                            PROTECT_AUTO_FILTER BOOLEAN DEFAULT FALSE,
                            PROTECT_PIVOT_TABLES BOOLEAN DEFAULT FALSE,
                            PROTECT_SORT BOOLEAN DEFAULT FALSE,
                            PROTECT_OBJECTS BOOLEAN DEFAULT FALSE,
                            PROTECT_SCENARIOS BOOLEAN DEFAULT FALSE,
                            PROTECT_SELECT_LOCKED_CELLS BOOLEAN DEFAULT FALSE,
                            PROTECT_SELECT_UNLOCK_CELLS BOOLEAN DEFAULT FALSE,
                            DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                            SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID)
    IS
            "@7555" INTEGER;
            "@7556" NUMBER;
            "@7557" NUMBER;
            "@7558" VARCHAR2(10);
            "@7559" NUMBER;
            "@7560" VARCHAR2(100);
            "@7561" NUMBER;
            
            FUNCTION "@7562" ("@7565" IN NUMBER, Y IN NUMBER) RETURN NUMBER IS
            BEGIN

              RETURN ("@7565" + Y - BITAND("@7565", Y));

            END;

            FUNCTION "@7563" ("@7565" IN NUMBER, Y IN NUMBER) RETURN NUMBER IS
            BEGIN

              RETURN ("@7562"("@7565", Y) - BITAND("@7565", Y));

            END;

            FUNCTION "@7564" ("@7572" IN CHAR) RETURN NUMBER IS
              "@7567"           NUMBER;
              "@7568"            NUMBER;
              "@7569"            NUMBER := 0;
              "@7570"     CHAR(1);
              "@7571" NUMBER;
            BEGIN
              "@7568" := LENGTH("@7572");
              FOR "@7567" IN 1.."@7568" LOOP
                 "@7570" := SUBSTR("@7572", "@7567", 1);
                 "@7571" := TO_NUMBER("@7570");
                 "@7569" := ("@7569" * 2) + "@7571";
              END LOOP;
              RETURN "@7569";
            END;
             
            FUNCTION "@7590" ("@7576" IN NUMBER) RETURN VARCHAR2 IS
              "@7574" VARCHAR2(64);
              "@7575"     NUMBER := "@7576";
            BEGIN
              WHILE ( "@7575" > 0 ) LOOP
                 "@7574" := MOD("@7575", 2) || "@7574";
                 "@7575" := TRUNC( "@7575" / 2 );
              END LOOP;
              RETURN LPAD("@7574", 16, '0');
            END;
    BEGIN
  
        "@7559" := LENGTH(PROTECT_PASSWORD);
        "@7555" := 0;
        "@7556" := "@7559";
        
        LOOP

            "@7558" := ASCII(SUBSTR(PROTECT_PASSWORD, "@7556", 1));
            "@7555" := "@7563"("@7555", "@7558");
            "@7560" := "@7590"("@7555");
            "@7560" := SUBSTR("@7560", 2, 16) || SUBSTR("@7560", 1, 1);
            "@7555" := "@7564"("@7560");
     
            EXIT WHEN "@7556" <= 1;
                
            "@7556" := "@7556" - 1;
            
        END LOOP;

        IF "@7559" > 9 THEN
            "@7559" := 9;
        END IF;

        "@7555" := "@7563"("@7555", "@7559");
        "@7555" := "@7563"("@7555", TO_NUMBER('CE4B', 'xxxx'));  
        
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7541" := TRUE;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7542" := REPLACE(TO_CHAR("@7555", '000X'), ' ', '');
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7544" := PROTECT_FORMAT_CELLS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7545" := PROTECT_FORMAT_COLUMNS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7546" := PROTECT_FORMAT_ROWS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7547" := PROTECT_INSERT_COLUMNS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7548" := PROTECT_INSERT_ROWS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7549" := PROTECT_INSERT_HYPERLINKS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7550" := PROTECT_DELETE_COLUMNS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7551" := PROTECT_DELETE_ROWS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7552" := PROTECT_AUTO_FILTER;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7553" := PROTECT_PIVOT_TABLES;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@7554" := PROTECT_SORT;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@8124" := PROTECT_OBJECTS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@8125" := PROTECT_SCENARIOS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@8126" := PROTECT_SELECT_LOCKED_CELLS;
        "@164"(DOC_ID)."@152"(SHEET_ID)."@8127" := PROTECT_SELECT_UNLOCK_CELLS;
   
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: /-0+:<+@,7::+')||SQLCODE||' '||SQLERRM);
            
    END;
    
    PROCEDURE SET_CELL_UNLOCKED (NAME VARCHAR2, 
                                 DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                 SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                 ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@9911" := FALSE; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@*130<4:;')||SQLCODE||' '||SQLERRM);
            
    END;
    
    
    PROCEDURE SET_CELL_LOCKED (NAME VARCHAR2, 
                                 DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID, 
                                 SHEET_ID PLS_INTEGER DEFAULT CURRENT_SHEET_ID, 
                                 ROW_ID PLS_INTEGER DEFAULT CURRENT_ROW_ID)
    IS
    BEGIN

        "@168" := COLUMN_ALPHA2NUMERIC(NAME);
        "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@29" := UPPER(NAME)||ROW_ID; 
        "@164"(DOC_ID)."@152"(SHEET_ID)."@93"("@168")."@9911" := TRUE; 
        "@169" := TRUE;

    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@30<4:;')||SQLCODE||' '||SQLERRM);
            
    END;
    
    PROCEDURE SET_CELL_UNLOCKED_DEFAULT (DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)
    IS
    BEGIN

       "@164"(DOC_ID)."@9912" := FALSE;
       "@169" := TRUE;
       
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: O-0<:;*-: ,:+@<:33@*130<4:;@;:9>*3+')||SQLCODE||' '||SQLERRM);
            
    END;
    
    PROCEDURE SET_CELL_LOCKED_DEFAULT (DOC_ID PLS_INTEGER DEFAULT CURRENT_DOC_ID)
    IS
    BEGIN

       "@164"(DOC_ID)."@9912" := TRUE;
       "@169" := TRUE;
        
    EXCEPTION
        WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20100, "@261"('O-0<:;*-: ,:+@<:33@30<4:;@;:9>*3+')||SQLCODE||' '||SQLERRM);
            
    END;
                                 
END;
/
